proteus  1.7.2
C/C++/Fortran libraries
cpartitioning.cpp
Go to the documentation of this file.
1 /* Generated by Cython 0.29.2 */
2 
3 #define PY_SSIZE_T_CLEAN
4 #include "Python.h"
5 #ifndef Py_PYTHON_H
6  #error Python headers needed to compile C extensions, please install development version of Python.
7 #elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000)
8  #error Cython requires Python 2.6+ or Python 3.3+.
9 #else
10 #define CYTHON_ABI "0_29_2"
11 #define CYTHON_HEX_VERSION 0x001D02F0
12 #define CYTHON_FUTURE_DIVISION 0
13 #include <stddef.h>
14 #ifndef offsetof
15  #define offsetof(type, member) ( (size_t) & ((type*)0) -> member )
16 #endif
17 #if !defined(WIN32) && !defined(MS_WINDOWS)
18  #ifndef __stdcall
19  #define __stdcall
20  #endif
21  #ifndef __cdecl
22  #define __cdecl
23  #endif
24  #ifndef __fastcall
25  #define __fastcall
26  #endif
27 #endif
28 #ifndef DL_IMPORT
29  #define DL_IMPORT(t) t
30 #endif
31 #ifndef DL_EXPORT
32  #define DL_EXPORT(t) t
33 #endif
34 #define __PYX_COMMA ,
35 #ifndef HAVE_LONG_LONG
36  #if PY_VERSION_HEX >= 0x02070000
37  #define HAVE_LONG_LONG
38  #endif
39 #endif
40 #ifndef PY_LONG_LONG
41  #define PY_LONG_LONG LONG_LONG
42 #endif
43 #ifndef Py_HUGE_VAL
44  #define Py_HUGE_VAL HUGE_VAL
45 #endif
46 #ifdef PYPY_VERSION
47  #define CYTHON_COMPILING_IN_PYPY 1
48  #define CYTHON_COMPILING_IN_PYSTON 0
49  #define CYTHON_COMPILING_IN_CPYTHON 0
50  #undef CYTHON_USE_TYPE_SLOTS
51  #define CYTHON_USE_TYPE_SLOTS 0
52  #undef CYTHON_USE_PYTYPE_LOOKUP
53  #define CYTHON_USE_PYTYPE_LOOKUP 0
54  #if PY_VERSION_HEX < 0x03050000
55  #undef CYTHON_USE_ASYNC_SLOTS
56  #define CYTHON_USE_ASYNC_SLOTS 0
57  #elif !defined(CYTHON_USE_ASYNC_SLOTS)
58  #define CYTHON_USE_ASYNC_SLOTS 1
59  #endif
60  #undef CYTHON_USE_PYLIST_INTERNALS
61  #define CYTHON_USE_PYLIST_INTERNALS 0
62  #undef CYTHON_USE_UNICODE_INTERNALS
63  #define CYTHON_USE_UNICODE_INTERNALS 0
64  #undef CYTHON_USE_UNICODE_WRITER
65  #define CYTHON_USE_UNICODE_WRITER 0
66  #undef CYTHON_USE_PYLONG_INTERNALS
67  #define CYTHON_USE_PYLONG_INTERNALS 0
68  #undef CYTHON_AVOID_BORROWED_REFS
69  #define CYTHON_AVOID_BORROWED_REFS 1
70  #undef CYTHON_ASSUME_SAFE_MACROS
71  #define CYTHON_ASSUME_SAFE_MACROS 0
72  #undef CYTHON_UNPACK_METHODS
73  #define CYTHON_UNPACK_METHODS 0
74  #undef CYTHON_FAST_THREAD_STATE
75  #define CYTHON_FAST_THREAD_STATE 0
76  #undef CYTHON_FAST_PYCALL
77  #define CYTHON_FAST_PYCALL 0
78  #undef CYTHON_PEP489_MULTI_PHASE_INIT
79  #define CYTHON_PEP489_MULTI_PHASE_INIT 0
80  #undef CYTHON_USE_TP_FINALIZE
81  #define CYTHON_USE_TP_FINALIZE 0
82  #undef CYTHON_USE_DICT_VERSIONS
83  #define CYTHON_USE_DICT_VERSIONS 0
84  #undef CYTHON_USE_EXC_INFO_STACK
85  #define CYTHON_USE_EXC_INFO_STACK 0
86 #elif defined(PYSTON_VERSION)
87  #define CYTHON_COMPILING_IN_PYPY 0
88  #define CYTHON_COMPILING_IN_PYSTON 1
89  #define CYTHON_COMPILING_IN_CPYTHON 0
90  #ifndef CYTHON_USE_TYPE_SLOTS
91  #define CYTHON_USE_TYPE_SLOTS 1
92  #endif
93  #undef CYTHON_USE_PYTYPE_LOOKUP
94  #define CYTHON_USE_PYTYPE_LOOKUP 0
95  #undef CYTHON_USE_ASYNC_SLOTS
96  #define CYTHON_USE_ASYNC_SLOTS 0
97  #undef CYTHON_USE_PYLIST_INTERNALS
98  #define CYTHON_USE_PYLIST_INTERNALS 0
99  #ifndef CYTHON_USE_UNICODE_INTERNALS
100  #define CYTHON_USE_UNICODE_INTERNALS 1
101  #endif
102  #undef CYTHON_USE_UNICODE_WRITER
103  #define CYTHON_USE_UNICODE_WRITER 0
104  #undef CYTHON_USE_PYLONG_INTERNALS
105  #define CYTHON_USE_PYLONG_INTERNALS 0
106  #ifndef CYTHON_AVOID_BORROWED_REFS
107  #define CYTHON_AVOID_BORROWED_REFS 0
108  #endif
109  #ifndef CYTHON_ASSUME_SAFE_MACROS
110  #define CYTHON_ASSUME_SAFE_MACROS 1
111  #endif
112  #ifndef CYTHON_UNPACK_METHODS
113  #define CYTHON_UNPACK_METHODS 1
114  #endif
115  #undef CYTHON_FAST_THREAD_STATE
116  #define CYTHON_FAST_THREAD_STATE 0
117  #undef CYTHON_FAST_PYCALL
118  #define CYTHON_FAST_PYCALL 0
119  #undef CYTHON_PEP489_MULTI_PHASE_INIT
120  #define CYTHON_PEP489_MULTI_PHASE_INIT 0
121  #undef CYTHON_USE_TP_FINALIZE
122  #define CYTHON_USE_TP_FINALIZE 0
123  #undef CYTHON_USE_DICT_VERSIONS
124  #define CYTHON_USE_DICT_VERSIONS 0
125  #undef CYTHON_USE_EXC_INFO_STACK
126  #define CYTHON_USE_EXC_INFO_STACK 0
127 #else
128  #define CYTHON_COMPILING_IN_PYPY 0
129  #define CYTHON_COMPILING_IN_PYSTON 0
130  #define CYTHON_COMPILING_IN_CPYTHON 1
131  #ifndef CYTHON_USE_TYPE_SLOTS
132  #define CYTHON_USE_TYPE_SLOTS 1
133  #endif
134  #if PY_VERSION_HEX < 0x02070000
135  #undef CYTHON_USE_PYTYPE_LOOKUP
136  #define CYTHON_USE_PYTYPE_LOOKUP 0
137  #elif !defined(CYTHON_USE_PYTYPE_LOOKUP)
138  #define CYTHON_USE_PYTYPE_LOOKUP 1
139  #endif
140  #if PY_MAJOR_VERSION < 3
141  #undef CYTHON_USE_ASYNC_SLOTS
142  #define CYTHON_USE_ASYNC_SLOTS 0
143  #elif !defined(CYTHON_USE_ASYNC_SLOTS)
144  #define CYTHON_USE_ASYNC_SLOTS 1
145  #endif
146  #if PY_VERSION_HEX < 0x02070000
147  #undef CYTHON_USE_PYLONG_INTERNALS
148  #define CYTHON_USE_PYLONG_INTERNALS 0
149  #elif !defined(CYTHON_USE_PYLONG_INTERNALS)
150  #define CYTHON_USE_PYLONG_INTERNALS 1
151  #endif
152  #ifndef CYTHON_USE_PYLIST_INTERNALS
153  #define CYTHON_USE_PYLIST_INTERNALS 1
154  #endif
155  #ifndef CYTHON_USE_UNICODE_INTERNALS
156  #define CYTHON_USE_UNICODE_INTERNALS 1
157  #endif
158  #if PY_VERSION_HEX < 0x030300F0
159  #undef CYTHON_USE_UNICODE_WRITER
160  #define CYTHON_USE_UNICODE_WRITER 0
161  #elif !defined(CYTHON_USE_UNICODE_WRITER)
162  #define CYTHON_USE_UNICODE_WRITER 1
163  #endif
164  #ifndef CYTHON_AVOID_BORROWED_REFS
165  #define CYTHON_AVOID_BORROWED_REFS 0
166  #endif
167  #ifndef CYTHON_ASSUME_SAFE_MACROS
168  #define CYTHON_ASSUME_SAFE_MACROS 1
169  #endif
170  #ifndef CYTHON_UNPACK_METHODS
171  #define CYTHON_UNPACK_METHODS 1
172  #endif
173  #ifndef CYTHON_FAST_THREAD_STATE
174  #define CYTHON_FAST_THREAD_STATE 1
175  #endif
176  #ifndef CYTHON_FAST_PYCALL
177  #define CYTHON_FAST_PYCALL 1
178  #endif
179  #ifndef CYTHON_PEP489_MULTI_PHASE_INIT
180  #define CYTHON_PEP489_MULTI_PHASE_INIT (PY_VERSION_HEX >= 0x03050000)
181  #endif
182  #ifndef CYTHON_USE_TP_FINALIZE
183  #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1)
184  #endif
185  #ifndef CYTHON_USE_DICT_VERSIONS
186  #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX >= 0x030600B1)
187  #endif
188  #ifndef CYTHON_USE_EXC_INFO_STACK
189  #define CYTHON_USE_EXC_INFO_STACK (PY_VERSION_HEX >= 0x030700A3)
190  #endif
191 #endif
192 #if !defined(CYTHON_FAST_PYCCALL)
193 #define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1)
194 #endif
195 #if CYTHON_USE_PYLONG_INTERNALS
196  #include "longintrepr.h"
197  #undef SHIFT
198  #undef BASE
199  #undef MASK
200  #ifdef SIZEOF_VOID_P
201  enum { __pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P == sizeof(void*)) };
202  #endif
203 #endif
204 #ifndef __has_attribute
205  #define __has_attribute(x) 0
206 #endif
207 #ifndef __has_cpp_attribute
208  #define __has_cpp_attribute(x) 0
209 #endif
210 #ifndef CYTHON_RESTRICT
211  #if defined(__GNUC__)
212  #define CYTHON_RESTRICT __restrict__
213  #elif defined(_MSC_VER) && _MSC_VER >= 1400
214  #define CYTHON_RESTRICT __restrict
215  #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
216  #define CYTHON_RESTRICT restrict
217  #else
218  #define CYTHON_RESTRICT
219  #endif
220 #endif
221 #ifndef CYTHON_UNUSED
222 # if defined(__GNUC__)
223 # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
224 # define CYTHON_UNUSED __attribute__ ((__unused__))
225 # else
226 # define CYTHON_UNUSED
227 # endif
228 # elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER))
229 # define CYTHON_UNUSED __attribute__ ((__unused__))
230 # else
231 # define CYTHON_UNUSED
232 # endif
233 #endif
234 #ifndef CYTHON_MAYBE_UNUSED_VAR
235 # if defined(__cplusplus)
236  template<class T> void CYTHON_MAYBE_UNUSED_VAR( const T& ) { }
237 # else
238 # define CYTHON_MAYBE_UNUSED_VAR(x) (void)(x)
239 # endif
240 #endif
241 #ifndef CYTHON_NCP_UNUSED
242 # if CYTHON_COMPILING_IN_CPYTHON
243 # define CYTHON_NCP_UNUSED
244 # else
245 # define CYTHON_NCP_UNUSED CYTHON_UNUSED
246 # endif
247 #endif
248 #define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None)
249 #ifdef _MSC_VER
250  #ifndef _MSC_STDINT_H_
251  #if _MSC_VER < 1300
252  typedef unsigned char uint8_t;
253  typedef unsigned int uint32_t;
254  #else
255  typedef unsigned __int8 uint8_t;
256  typedef unsigned __int32 uint32_t;
257  #endif
258  #endif
259 #else
260  #include <stdint.h>
261 #endif
262 #ifndef CYTHON_FALLTHROUGH
263  #if defined(__cplusplus) && __cplusplus >= 201103L
264  #if __has_cpp_attribute(fallthrough)
265  #define CYTHON_FALLTHROUGH [[fallthrough]]
266  #elif __has_cpp_attribute(clang::fallthrough)
267  #define CYTHON_FALLTHROUGH [[clang::fallthrough]]
268  #elif __has_cpp_attribute(gnu::fallthrough)
269  #define CYTHON_FALLTHROUGH [[gnu::fallthrough]]
270  #endif
271  #endif
272  #ifndef CYTHON_FALLTHROUGH
273  #if __has_attribute(fallthrough)
274  #define CYTHON_FALLTHROUGH __attribute__((fallthrough))
275  #else
276  #define CYTHON_FALLTHROUGH
277  #endif
278  #endif
279  #if defined(__clang__ ) && defined(__apple_build_version__)
280  #if __apple_build_version__ < 7000000
281  #undef CYTHON_FALLTHROUGH
282  #define CYTHON_FALLTHROUGH
283  #endif
284  #endif
285 #endif
286 
287 #ifndef __cplusplus
288  #error "Cython files generated with the C++ option must be compiled with a C++ compiler."
289 #endif
290 #ifndef CYTHON_INLINE
291  #if defined(__clang__)
292  #define CYTHON_INLINE __inline__ __attribute__ ((__unused__))
293  #else
294  #define CYTHON_INLINE inline
295  #endif
296 #endif
297 template<typename T>
298 void __Pyx_call_destructor(T& x) {
299  x.~T();
300 }
301 template<typename T>
302 class __Pyx_FakeReference {
303  public:
304  __Pyx_FakeReference() : ptr(NULL) { }
305  __Pyx_FakeReference(const T& ref) : ptr(const_cast<T*>(&ref)) { }
306  T *operator->() { return ptr; }
307  T *operator&() { return ptr; }
308  operator T&() { return *ptr; }
309  template<typename U> bool operator ==(U other) { return *ptr == other; }
310  template<typename U> bool operator !=(U other) { return *ptr != other; }
311  private:
312  T *ptr;
313 };
314 
315 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag)
316  #define Py_OptimizeFlag 0
317 #endif
318 #define __PYX_BUILD_PY_SSIZE_T "n"
319 #define CYTHON_FORMAT_SSIZE_T "z"
320 #if PY_MAJOR_VERSION < 3
321  #define __Pyx_BUILTIN_MODULE_NAME "__builtin__"
322  #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
323  PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
324  #define __Pyx_DefaultClassType PyClass_Type
325 #else
326  #define __Pyx_BUILTIN_MODULE_NAME "builtins"
327  #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
328  PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
329  #define __Pyx_DefaultClassType PyType_Type
330 #endif
331 #ifndef Py_TPFLAGS_CHECKTYPES
332  #define Py_TPFLAGS_CHECKTYPES 0
333 #endif
334 #ifndef Py_TPFLAGS_HAVE_INDEX
335  #define Py_TPFLAGS_HAVE_INDEX 0
336 #endif
337 #ifndef Py_TPFLAGS_HAVE_NEWBUFFER
338  #define Py_TPFLAGS_HAVE_NEWBUFFER 0
339 #endif
340 #ifndef Py_TPFLAGS_HAVE_FINALIZE
341  #define Py_TPFLAGS_HAVE_FINALIZE 0
342 #endif
343 #ifndef METH_STACKLESS
344  #define METH_STACKLESS 0
345 #endif
346 #if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL)
347  #ifndef METH_FASTCALL
348  #define METH_FASTCALL 0x80
349  #endif
350  typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject *const *args, Py_ssize_t nargs);
351  typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject *const *args,
352  Py_ssize_t nargs, PyObject *kwnames);
353 #else
354  #define __Pyx_PyCFunctionFast _PyCFunctionFast
355  #define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords
356 #endif
357 #if CYTHON_FAST_PYCCALL
358 #define __Pyx_PyFastCFunction_Check(func)\
359  ((PyCFunction_Check(func) && (METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS)))))
360 #else
361 #define __Pyx_PyFastCFunction_Check(func) 0
362 #endif
363 #if CYTHON_USE_DICT_VERSIONS
364 #define __PYX_GET_DICT_VERSION(dict) (((PyDictObject*)(dict))->ma_version_tag)
365 #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\
366  (version_var) = __PYX_GET_DICT_VERSION(dict);\
367  (cache_var) = (value);
368 #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\
369  static PY_UINT64_T __pyx_dict_version = 0;\
370  static PyObject *__pyx_dict_cached_value = NULL;\
371  if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\
372  (VAR) = __pyx_dict_cached_value;\
373  } else {\
374  (VAR) = __pyx_dict_cached_value = (LOOKUP);\
375  __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\
376  }\
377  }
378 #else
379 #define __PYX_GET_DICT_VERSION(dict) (0)
380 #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)
381 #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) (VAR) = (LOOKUP);
382 #endif
383 #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc)
384  #define PyObject_Malloc(s) PyMem_Malloc(s)
385  #define PyObject_Free(p) PyMem_Free(p)
386  #define PyObject_Realloc(p) PyMem_Realloc(p)
387 #endif
388 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030400A1
389  #define PyMem_RawMalloc(n) PyMem_Malloc(n)
390  #define PyMem_RawRealloc(p, n) PyMem_Realloc(p, n)
391  #define PyMem_RawFree(p) PyMem_Free(p)
392 #endif
393 #if CYTHON_COMPILING_IN_PYSTON
394  #define __Pyx_PyCode_HasFreeVars(co) PyCode_HasFreeVars(co)
395  #define __Pyx_PyFrame_SetLineNumber(frame, lineno) PyFrame_SetLineNumber(frame, lineno)
396 #else
397  #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0)
398  #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno)
399 #endif
400 #if !CYTHON_FAST_THREAD_STATE || PY_VERSION_HEX < 0x02070000
401  #define __Pyx_PyThreadState_Current PyThreadState_GET()
402 #elif PY_VERSION_HEX >= 0x03060000
403  #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet()
404 #elif PY_VERSION_HEX >= 0x03000000
405  #define __Pyx_PyThreadState_Current PyThreadState_GET()
406 #else
407  #define __Pyx_PyThreadState_Current _PyThreadState_Current
408 #endif
409 #if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT)
410 #include "pythread.h"
411 #define Py_tss_NEEDS_INIT 0
412 typedef int Py_tss_t;
413 static CYTHON_INLINE int PyThread_tss_create(Py_tss_t *key) {
414  *key = PyThread_create_key();
415  return 0; // PyThread_create_key reports success always
416 }
417 static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(void) {
418  Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(sizeof(Py_tss_t));
419  *key = Py_tss_NEEDS_INIT;
420  return key;
421 }
422 static CYTHON_INLINE void PyThread_tss_free(Py_tss_t *key) {
423  PyObject_Free(key);
424 }
425 static CYTHON_INLINE int PyThread_tss_is_created(Py_tss_t *key) {
426  return *key != Py_tss_NEEDS_INIT;
427 }
428 static CYTHON_INLINE void PyThread_tss_delete(Py_tss_t *key) {
429  PyThread_delete_key(*key);
430  *key = Py_tss_NEEDS_INIT;
431 }
432 static CYTHON_INLINE int PyThread_tss_set(Py_tss_t *key, void *value) {
433  return PyThread_set_key_value(*key, value);
434 }
435 static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) {
436  return PyThread_get_key_value(*key);
437 }
438 #endif // TSS (Thread Specific Storage) API
439 #if CYTHON_COMPILING_IN_CPYTHON || defined(_PyDict_NewPresized)
440 #define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n))
441 #else
442 #define __Pyx_PyDict_NewPresized(n) PyDict_New()
443 #endif
444 #if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION
445  #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y)
446  #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y)
447 #else
448  #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y)
449  #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y)
450 #endif
451 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && CYTHON_USE_UNICODE_INTERNALS
452 #define __Pyx_PyDict_GetItemStr(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash)
453 #else
454 #define __Pyx_PyDict_GetItemStr(dict, name) PyDict_GetItem(dict, name)
455 #endif
456 #if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND)
457  #define CYTHON_PEP393_ENABLED 1
458  #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\
459  0 : _PyUnicode_Ready((PyObject *)(op)))
460  #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u)
461  #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i)
462  #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u)
463  #define __Pyx_PyUnicode_KIND(u) PyUnicode_KIND(u)
464  #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u)
465  #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i)
466  #define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, ch)
467  #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u)))
468 #else
469  #define CYTHON_PEP393_ENABLED 0
470  #define PyUnicode_1BYTE_KIND 1
471  #define PyUnicode_2BYTE_KIND 2
472  #define PyUnicode_4BYTE_KIND 4
473  #define __Pyx_PyUnicode_READY(op) (0)
474  #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u)
475  #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i]))
476  #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((sizeof(Py_UNICODE) == 2) ? 65535 : 1114111)
477  #define __Pyx_PyUnicode_KIND(u) (sizeof(Py_UNICODE))
478  #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u))
479  #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i]))
480  #define __Pyx_PyUnicode_WRITE(k, d, i, ch) (((void)(k)), ((Py_UNICODE*)d)[i] = ch)
481  #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_SIZE(u))
482 #endif
483 #if CYTHON_COMPILING_IN_PYPY
484  #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b)
485  #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b)
486 #else
487  #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b)
488  #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\
489  PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b))
490 #endif
491 #if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_Contains)
492  #define PyUnicode_Contains(u, s) PySequence_Contains(u, s)
493 #endif
494 #if CYTHON_COMPILING_IN_PYPY && !defined(PyByteArray_Check)
495  #define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type)
496 #endif
497 #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Format)
498  #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt)
499 #endif
500 #define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyString_Check(b) && !PyString_CheckExact(b)))) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b))
501 #define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyUnicode_Check(b) && !PyUnicode_CheckExact(b)))) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b))
502 #if PY_MAJOR_VERSION >= 3
503  #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b)
504 #else
505  #define __Pyx_PyString_Format(a, b) PyString_Format(a, b)
506 #endif
507 #if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII)
508  #define PyObject_ASCII(o) PyObject_Repr(o)
509 #endif
510 #if PY_MAJOR_VERSION >= 3
511  #define PyBaseString_Type PyUnicode_Type
512  #define PyStringObject PyUnicodeObject
513  #define PyString_Type PyUnicode_Type
514  #define PyString_Check PyUnicode_Check
515  #define PyString_CheckExact PyUnicode_CheckExact
516  #define PyObject_Unicode PyObject_Str
517 #endif
518 #if PY_MAJOR_VERSION >= 3
519  #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj)
520  #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj)
521 #else
522  #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj))
523  #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj))
524 #endif
525 #ifndef PySet_CheckExact
526  #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type)
527 #endif
528 #if CYTHON_ASSUME_SAFE_MACROS
529  #define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq)
530 #else
531  #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq)
532 #endif
533 #if PY_MAJOR_VERSION >= 3
534  #define PyIntObject PyLongObject
535  #define PyInt_Type PyLong_Type
536  #define PyInt_Check(op) PyLong_Check(op)
537  #define PyInt_CheckExact(op) PyLong_CheckExact(op)
538  #define PyInt_FromString PyLong_FromString
539  #define PyInt_FromUnicode PyLong_FromUnicode
540  #define PyInt_FromLong PyLong_FromLong
541  #define PyInt_FromSize_t PyLong_FromSize_t
542  #define PyInt_FromSsize_t PyLong_FromSsize_t
543  #define PyInt_AsLong PyLong_AsLong
544  #define PyInt_AS_LONG PyLong_AS_LONG
545  #define PyInt_AsSsize_t PyLong_AsSsize_t
546  #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask
547  #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask
548  #define PyNumber_Int PyNumber_Long
549 #endif
550 #if PY_MAJOR_VERSION >= 3
551  #define PyBoolObject PyLongObject
552 #endif
553 #if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY
554  #ifndef PyUnicode_InternFromString
555  #define PyUnicode_InternFromString(s) PyUnicode_FromString(s)
556  #endif
557 #endif
558 #if PY_VERSION_HEX < 0x030200A4
559  typedef long Py_hash_t;
560  #define __Pyx_PyInt_FromHash_t PyInt_FromLong
561  #define __Pyx_PyInt_AsHash_t PyInt_AsLong
562 #else
563  #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t
564  #define __Pyx_PyInt_AsHash_t PyInt_AsSsize_t
565 #endif
566 #if PY_MAJOR_VERSION >= 3
567  #define __Pyx_PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : (Py_INCREF(func), func))
568 #else
569  #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass)
570 #endif
571 #if CYTHON_USE_ASYNC_SLOTS
572  #if PY_VERSION_HEX >= 0x030500B1
573  #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods
574  #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async)
575  #else
576  #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved))
577  #endif
578 #else
579  #define __Pyx_PyType_AsAsync(obj) NULL
580 #endif
581 #ifndef __Pyx_PyAsyncMethodsStruct
582  typedef struct {
583  unaryfunc am_await;
584  unaryfunc am_aiter;
585  unaryfunc am_anext;
586  } __Pyx_PyAsyncMethodsStruct;
587 #endif
588 
589 #if defined(WIN32) || defined(MS_WINDOWS)
590  #define _USE_MATH_DEFINES
591 #endif
592 #include <math.h>
593 #ifdef NAN
594 #define __PYX_NAN() ((float) NAN)
595 #else
596 static CYTHON_INLINE float __PYX_NAN() {
597  float value;
598  memset(&value, 0xFF, sizeof(value));
599  return value;
600 }
601 #endif
602 #if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL)
603 #define __Pyx_truncl trunc
604 #else
605 #define __Pyx_truncl truncl
606 #endif
607 
608 
609 #define __PYX_ERR(f_index, lineno, Ln_error) \
610 { \
611  __pyx_filename = __pyx_f[f_index]; __pyx_lineno = lineno; __pyx_clineno = __LINE__; goto Ln_error; \
612 }
613 
614 #ifndef __PYX_EXTERN_C
615  #ifdef __cplusplus
616  #define __PYX_EXTERN_C extern "C"
617  #else
618  #define __PYX_EXTERN_C extern
619  #endif
620 #endif
621 
622 #define __PYX_HAVE__cpartitioning
623 #define __PYX_HAVE_API__cpartitioning
624 /* Early includes */
625 #include <string.h>
626 #include <stdio.h>
627 #include "numpy/arrayobject.h"
628 #include "numpy/ufuncobject.h"
629 #include "mpi.h"
630 #include "mesh.h"
631 #include "partitioning.h"
632 #include "pythread.h"
633 #include <stdlib.h>
634 #include "pystate.h"
635 #ifdef _OPENMP
636 #include <omp.h>
637 #endif /* _OPENMP */
638 
639 #if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS)
640 #define CYTHON_WITHOUT_ASSERTIONS
641 #endif
642 
643 typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* encoding;
644  const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry;
645 
646 #define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0
647 #define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT 0
648 #define __PYX_DEFAULT_STRING_ENCODING ""
649 #define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString
650 #define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
651 #define __Pyx_uchar_cast(c) ((unsigned char)c)
652 #define __Pyx_long_cast(x) ((long)x)
653 #define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\
654  (sizeof(type) < sizeof(Py_ssize_t)) ||\
655  (sizeof(type) > sizeof(Py_ssize_t) &&\
656  likely(v < (type)PY_SSIZE_T_MAX ||\
657  v == (type)PY_SSIZE_T_MAX) &&\
658  (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\
659  v == (type)PY_SSIZE_T_MIN))) ||\
660  (sizeof(type) == sizeof(Py_ssize_t) &&\
661  (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\
662  v == (type)PY_SSIZE_T_MAX))) )
663 static CYTHON_INLINE int __Pyx_is_valid_index(Py_ssize_t i, Py_ssize_t limit) {
664  return (size_t) i < (size_t) limit;
665 }
666 #if defined (__cplusplus) && __cplusplus >= 201103L
667  #include <cstdlib>
668  #define __Pyx_sst_abs(value) std::abs(value)
669 #elif SIZEOF_INT >= SIZEOF_SIZE_T
670  #define __Pyx_sst_abs(value) abs(value)
671 #elif SIZEOF_LONG >= SIZEOF_SIZE_T
672  #define __Pyx_sst_abs(value) labs(value)
673 #elif defined (_MSC_VER)
674  #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value))
675 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
676  #define __Pyx_sst_abs(value) llabs(value)
677 #elif defined (__GNUC__)
678  #define __Pyx_sst_abs(value) __builtin_llabs(value)
679 #else
680  #define __Pyx_sst_abs(value) ((value<0) ? -value : value)
681 #endif
682 static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject*);
683 static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length);
684 #define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s))
685 #define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l)
686 #define __Pyx_PyBytes_FromString PyBytes_FromString
687 #define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize
688 static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*);
689 #if PY_MAJOR_VERSION < 3
690  #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString
691  #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
692 #else
693  #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString
694  #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize
695 #endif
696 #define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s))
697 #define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s))
698 #define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s))
699 #define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s))
700 #define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s))
701 #define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s))
702 #define __Pyx_PyObject_AsWritableString(s) ((char*) __Pyx_PyObject_AsString(s))
703 #define __Pyx_PyObject_AsWritableSString(s) ((signed char*) __Pyx_PyObject_AsString(s))
704 #define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s))
705 #define __Pyx_PyObject_AsSString(s) ((const signed char*) __Pyx_PyObject_AsString(s))
706 #define __Pyx_PyObject_AsUString(s) ((const unsigned char*) __Pyx_PyObject_AsString(s))
707 #define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s)
708 #define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s)
709 #define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s)
710 #define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s)
711 #define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s)
712 static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) {
713  const Py_UNICODE *u_end = u;
714  while (*u_end++) ;
715  return (size_t)(u_end - u - 1);
716 }
717 #define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u))
718 #define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode
719 #define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode
720 #define __Pyx_NewRef(obj) (Py_INCREF(obj), obj)
721 #define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None)
722 static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b);
723 static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*);
724 static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject*);
725 static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x);
726 #define __Pyx_PySequence_Tuple(obj)\
727  (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj))
728 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
729 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t);
730 #if CYTHON_ASSUME_SAFE_MACROS
731 #define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x))
732 #else
733 #define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x)
734 #endif
735 #define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x))
736 #if PY_MAJOR_VERSION >= 3
737 #define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x))
738 #else
739 #define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x))
740 #endif
741 #define __Pyx_PyNumber_Float(x) (PyFloat_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Float(x))
742 #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
743 static int __Pyx_sys_getdefaultencoding_not_ascii;
744 static int __Pyx_init_sys_getdefaultencoding_params(void) {
745  PyObject* sys;
746  PyObject* default_encoding = NULL;
747  PyObject* ascii_chars_u = NULL;
748  PyObject* ascii_chars_b = NULL;
749  const char* default_encoding_c;
750  sys = PyImport_ImportModule("sys");
751  if (!sys) goto bad;
752  default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL);
753  Py_DECREF(sys);
754  if (!default_encoding) goto bad;
755  default_encoding_c = PyBytes_AsString(default_encoding);
756  if (!default_encoding_c) goto bad;
757  if (strcmp(default_encoding_c, "ascii") == 0) {
758  __Pyx_sys_getdefaultencoding_not_ascii = 0;
759  } else {
760  char ascii_chars[128];
761  int c;
762  for (c = 0; c < 128; c++) {
763  ascii_chars[c] = c;
764  }
765  __Pyx_sys_getdefaultencoding_not_ascii = 1;
766  ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL);
767  if (!ascii_chars_u) goto bad;
768  ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL);
769  if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) {
770  PyErr_Format(
771  PyExc_ValueError,
772  "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.",
773  default_encoding_c);
774  goto bad;
775  }
776  Py_DECREF(ascii_chars_u);
777  Py_DECREF(ascii_chars_b);
778  }
779  Py_DECREF(default_encoding);
780  return 0;
781 bad:
782  Py_XDECREF(default_encoding);
783  Py_XDECREF(ascii_chars_u);
784  Py_XDECREF(ascii_chars_b);
785  return -1;
786 }
787 #endif
788 #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3
789 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL)
790 #else
791 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL)
792 #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
793 static char* __PYX_DEFAULT_STRING_ENCODING;
794 static int __Pyx_init_sys_getdefaultencoding_params(void) {
795  PyObject* sys;
796  PyObject* default_encoding = NULL;
797  char* default_encoding_c;
798  sys = PyImport_ImportModule("sys");
799  if (!sys) goto bad;
800  default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL);
801  Py_DECREF(sys);
802  if (!default_encoding) goto bad;
803  default_encoding_c = PyBytes_AsString(default_encoding);
804  if (!default_encoding_c) goto bad;
805  __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c) + 1);
806  if (!__PYX_DEFAULT_STRING_ENCODING) goto bad;
807  strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c);
808  Py_DECREF(default_encoding);
809  return 0;
810 bad:
811  Py_XDECREF(default_encoding);
812  return -1;
813 }
814 #endif
815 #endif
816 
817 
818 /* Test for GCC > 2.95 */
819 #if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)))
820  #define likely(x) __builtin_expect(!!(x), 1)
821  #define unlikely(x) __builtin_expect(!!(x), 0)
822 #else /* !__GNUC__ or GCC < 2.95 */
823  #define likely(x) (x)
824  #define unlikely(x) (x)
825 #endif /* __GNUC__ */
826 static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; }
827 
828 static PyObject *__pyx_m = NULL;
829 static PyObject *__pyx_d;
830 static PyObject *__pyx_b;
831 static PyObject *__pyx_cython_runtime = NULL;
832 static PyObject *__pyx_empty_tuple;
833 static PyObject *__pyx_empty_bytes;
834 static PyObject *__pyx_empty_unicode;
835 static int __pyx_lineno;
836 static int __pyx_clineno = 0;
837 static const char * __pyx_cfilenm= __FILE__;
838 static const char *__pyx_filename;
839 
840 /* Header.proto */
841 #if !defined(CYTHON_CCOMPLEX)
842  #if defined(__cplusplus)
843  #define CYTHON_CCOMPLEX 1
844  #elif defined(_Complex_I)
845  #define CYTHON_CCOMPLEX 1
846  #else
847  #define CYTHON_CCOMPLEX 0
848  #endif
849 #endif
850 #if CYTHON_CCOMPLEX
851  #ifdef __cplusplus
852  #include <complex>
853  #else
854  #include <complex.h>
855  #endif
856 #endif
857 #if CYTHON_CCOMPLEX && !defined(__cplusplus) && defined(__sun__) && defined(__GNUC__)
858  #undef _Complex_I
859  #define _Complex_I 1.0fj
860 #endif
861 
862 
863 static const char *__pyx_f[] = {
864  "proteus/cpartitioning.pyx",
865  "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd",
866  "stringsource",
867  "linux/lib/python3.7/site-packages/Cython/Includes/cpython/type.pxd",
868  "linux/lib/python3.7/site-packages/mpi4py/MPI.pxd",
869  "proteus/cmeshTools.pxd",
870 };
871 /* ForceInitThreads.proto */
872 #ifndef __PYX_FORCE_INIT_THREADS
873  #define __PYX_FORCE_INIT_THREADS 0
874 #endif
875 
876 /* NoFastGil.proto */
877 #define __Pyx_PyGILState_Ensure PyGILState_Ensure
878 #define __Pyx_PyGILState_Release PyGILState_Release
879 #define __Pyx_FastGIL_Remember()
880 #define __Pyx_FastGIL_Forget()
881 #define __Pyx_FastGilFuncInit()
882 
883 /* BufferFormatStructs.proto */
884 #define IS_UNSIGNED(type) (((type) -1) > 0)
885 struct __Pyx_StructField_;
886 #define __PYX_BUF_FLAGS_PACKED_STRUCT (1 << 0)
887 typedef struct {
888  const char* name;
889  struct __Pyx_StructField_* fields;
890  size_t size;
891  size_t arraysize[8];
892  int ndim;
893  char typegroup;
894  char is_unsigned;
895  int flags;
896 } __Pyx_TypeInfo;
897 typedef struct __Pyx_StructField_ {
898  __Pyx_TypeInfo* type;
899  const char* name;
900  size_t offset;
901 } __Pyx_StructField;
902 typedef struct {
903  __Pyx_StructField* field;
904  size_t parent_offset;
905 } __Pyx_BufFmt_StackElem;
906 typedef struct {
907  __Pyx_StructField root;
908  __Pyx_BufFmt_StackElem* head;
909  size_t fmt_offset;
910  size_t new_count, enc_count;
911  size_t struct_alignment;
912  int is_complex;
913  char enc_type;
914  char new_packmode;
915  char enc_packmode;
916  char is_valid_array;
917 } __Pyx_BufFmt_Context;
918 
919 /* Atomics.proto */
920 #include <pythread.h>
921 #ifndef CYTHON_ATOMICS
922  #define CYTHON_ATOMICS 1
923 #endif
924 #define __pyx_atomic_int_type int
925 #if CYTHON_ATOMICS && __GNUC__ >= 4 && (__GNUC_MINOR__ > 1 ||\
926  (__GNUC_MINOR__ == 1 && __GNUC_PATCHLEVEL >= 2)) &&\
927  !defined(__i386__)
928  #define __pyx_atomic_incr_aligned(value, lock) __sync_fetch_and_add(value, 1)
929  #define __pyx_atomic_decr_aligned(value, lock) __sync_fetch_and_sub(value, 1)
930  #ifdef __PYX_DEBUG_ATOMICS
931  #warning "Using GNU atomics"
932  #endif
933 #elif CYTHON_ATOMICS && defined(_MSC_VER) && 0
934  #include <Windows.h>
935  #undef __pyx_atomic_int_type
936  #define __pyx_atomic_int_type LONG
937  #define __pyx_atomic_incr_aligned(value, lock) InterlockedIncrement(value)
938  #define __pyx_atomic_decr_aligned(value, lock) InterlockedDecrement(value)
939  #ifdef __PYX_DEBUG_ATOMICS
940  #pragma message ("Using MSVC atomics")
941  #endif
942 #elif CYTHON_ATOMICS && (defined(__ICC) || defined(__INTEL_COMPILER)) && 0
943  #define __pyx_atomic_incr_aligned(value, lock) _InterlockedIncrement(value)
944  #define __pyx_atomic_decr_aligned(value, lock) _InterlockedDecrement(value)
945  #ifdef __PYX_DEBUG_ATOMICS
946  #warning "Using Intel atomics"
947  #endif
948 #else
949  #undef CYTHON_ATOMICS
950  #define CYTHON_ATOMICS 0
951  #ifdef __PYX_DEBUG_ATOMICS
952  #warning "Not using atomics"
953  #endif
954 #endif
955 typedef volatile __pyx_atomic_int_type __pyx_atomic_int;
956 #if CYTHON_ATOMICS
957  #define __pyx_add_acquisition_count(memview)\
958  __pyx_atomic_incr_aligned(__pyx_get_slice_count_pointer(memview), memview->lock)
959  #define __pyx_sub_acquisition_count(memview)\
960  __pyx_atomic_decr_aligned(__pyx_get_slice_count_pointer(memview), memview->lock)
961 #else
962  #define __pyx_add_acquisition_count(memview)\
963  __pyx_add_acquisition_count_locked(__pyx_get_slice_count_pointer(memview), memview->lock)
964  #define __pyx_sub_acquisition_count(memview)\
965  __pyx_sub_acquisition_count_locked(__pyx_get_slice_count_pointer(memview), memview->lock)
966 #endif
967 
968 /* MemviewSliceStruct.proto */
969 struct __pyx_memoryview_obj;
970 typedef struct {
971  struct __pyx_memoryview_obj *memview;
972  char *data;
973  Py_ssize_t shape[8];
974  Py_ssize_t strides[8];
975  Py_ssize_t suboffsets[8];
976 } __Pyx_memviewslice;
977 #define __Pyx_MemoryView_Len(m) (m.shape[0])
978 
979 
980 /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":776
981  * # in Cython to enable them only on the right systems.
982  *
983  * ctypedef npy_int8 int8_t # <<<<<<<<<<<<<<
984  * ctypedef npy_int16 int16_t
985  * ctypedef npy_int32 int32_t
986  */
987 typedef npy_int8 __pyx_t_5numpy_int8_t;
988 
989 /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":777
990  *
991  * ctypedef npy_int8 int8_t
992  * ctypedef npy_int16 int16_t # <<<<<<<<<<<<<<
993  * ctypedef npy_int32 int32_t
994  * ctypedef npy_int64 int64_t
995  */
996 typedef npy_int16 __pyx_t_5numpy_int16_t;
997 
998 /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":778
999  * ctypedef npy_int8 int8_t
1000  * ctypedef npy_int16 int16_t
1001  * ctypedef npy_int32 int32_t # <<<<<<<<<<<<<<
1002  * ctypedef npy_int64 int64_t
1003  * #ctypedef npy_int96 int96_t
1004  */
1005 typedef npy_int32 __pyx_t_5numpy_int32_t;
1006 
1007 /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":779
1008  * ctypedef npy_int16 int16_t
1009  * ctypedef npy_int32 int32_t
1010  * ctypedef npy_int64 int64_t # <<<<<<<<<<<<<<
1011  * #ctypedef npy_int96 int96_t
1012  * #ctypedef npy_int128 int128_t
1013  */
1014 typedef npy_int64 __pyx_t_5numpy_int64_t;
1015 
1016 /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":783
1017  * #ctypedef npy_int128 int128_t
1018  *
1019  * ctypedef npy_uint8 uint8_t # <<<<<<<<<<<<<<
1020  * ctypedef npy_uint16 uint16_t
1021  * ctypedef npy_uint32 uint32_t
1022  */
1023 typedef npy_uint8 __pyx_t_5numpy_uint8_t;
1024 
1025 /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":784
1026  *
1027  * ctypedef npy_uint8 uint8_t
1028  * ctypedef npy_uint16 uint16_t # <<<<<<<<<<<<<<
1029  * ctypedef npy_uint32 uint32_t
1030  * ctypedef npy_uint64 uint64_t
1031  */
1032 typedef npy_uint16 __pyx_t_5numpy_uint16_t;
1033 
1034 /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":785
1035  * ctypedef npy_uint8 uint8_t
1036  * ctypedef npy_uint16 uint16_t
1037  * ctypedef npy_uint32 uint32_t # <<<<<<<<<<<<<<
1038  * ctypedef npy_uint64 uint64_t
1039  * #ctypedef npy_uint96 uint96_t
1040  */
1041 typedef npy_uint32 __pyx_t_5numpy_uint32_t;
1042 
1043 /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":786
1044  * ctypedef npy_uint16 uint16_t
1045  * ctypedef npy_uint32 uint32_t
1046  * ctypedef npy_uint64 uint64_t # <<<<<<<<<<<<<<
1047  * #ctypedef npy_uint96 uint96_t
1048  * #ctypedef npy_uint128 uint128_t
1049  */
1050 typedef npy_uint64 __pyx_t_5numpy_uint64_t;
1051 
1052 /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":790
1053  * #ctypedef npy_uint128 uint128_t
1054  *
1055  * ctypedef npy_float32 float32_t # <<<<<<<<<<<<<<
1056  * ctypedef npy_float64 float64_t
1057  * #ctypedef npy_float80 float80_t
1058  */
1059 typedef npy_float32 __pyx_t_5numpy_float32_t;
1060 
1061 /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":791
1062  *
1063  * ctypedef npy_float32 float32_t
1064  * ctypedef npy_float64 float64_t # <<<<<<<<<<<<<<
1065  * #ctypedef npy_float80 float80_t
1066  * #ctypedef npy_float128 float128_t
1067  */
1068 typedef npy_float64 __pyx_t_5numpy_float64_t;
1069 
1070 /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":800
1071  * # The int types are mapped a bit surprising --
1072  * # numpy.int corresponds to 'l' and numpy.long to 'q'
1073  * ctypedef npy_long int_t # <<<<<<<<<<<<<<
1074  * ctypedef npy_longlong long_t
1075  * ctypedef npy_longlong longlong_t
1076  */
1077 typedef npy_long __pyx_t_5numpy_int_t;
1078 
1079 /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":801
1080  * # numpy.int corresponds to 'l' and numpy.long to 'q'
1081  * ctypedef npy_long int_t
1082  * ctypedef npy_longlong long_t # <<<<<<<<<<<<<<
1083  * ctypedef npy_longlong longlong_t
1084  *
1085  */
1086 typedef npy_longlong __pyx_t_5numpy_long_t;
1087 
1088 /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":802
1089  * ctypedef npy_long int_t
1090  * ctypedef npy_longlong long_t
1091  * ctypedef npy_longlong longlong_t # <<<<<<<<<<<<<<
1092  *
1093  * ctypedef npy_ulong uint_t
1094  */
1095 typedef npy_longlong __pyx_t_5numpy_longlong_t;
1096 
1097 /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":804
1098  * ctypedef npy_longlong longlong_t
1099  *
1100  * ctypedef npy_ulong uint_t # <<<<<<<<<<<<<<
1101  * ctypedef npy_ulonglong ulong_t
1102  * ctypedef npy_ulonglong ulonglong_t
1103  */
1104 typedef npy_ulong __pyx_t_5numpy_uint_t;
1105 
1106 /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":805
1107  *
1108  * ctypedef npy_ulong uint_t
1109  * ctypedef npy_ulonglong ulong_t # <<<<<<<<<<<<<<
1110  * ctypedef npy_ulonglong ulonglong_t
1111  *
1112  */
1113 typedef npy_ulonglong __pyx_t_5numpy_ulong_t;
1114 
1115 /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":806
1116  * ctypedef npy_ulong uint_t
1117  * ctypedef npy_ulonglong ulong_t
1118  * ctypedef npy_ulonglong ulonglong_t # <<<<<<<<<<<<<<
1119  *
1120  * ctypedef npy_intp intp_t
1121  */
1122 typedef npy_ulonglong __pyx_t_5numpy_ulonglong_t;
1123 
1124 /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":808
1125  * ctypedef npy_ulonglong ulonglong_t
1126  *
1127  * ctypedef npy_intp intp_t # <<<<<<<<<<<<<<
1128  * ctypedef npy_uintp uintp_t
1129  *
1130  */
1131 typedef npy_intp __pyx_t_5numpy_intp_t;
1132 
1133 /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":809
1134  *
1135  * ctypedef npy_intp intp_t
1136  * ctypedef npy_uintp uintp_t # <<<<<<<<<<<<<<
1137  *
1138  * ctypedef npy_double float_t
1139  */
1140 typedef npy_uintp __pyx_t_5numpy_uintp_t;
1141 
1142 /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":811
1143  * ctypedef npy_uintp uintp_t
1144  *
1145  * ctypedef npy_double float_t # <<<<<<<<<<<<<<
1146  * ctypedef npy_double double_t
1147  * ctypedef npy_longdouble longdouble_t
1148  */
1149 typedef npy_double __pyx_t_5numpy_float_t;
1150 
1151 /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":812
1152  *
1153  * ctypedef npy_double float_t
1154  * ctypedef npy_double double_t # <<<<<<<<<<<<<<
1155  * ctypedef npy_longdouble longdouble_t
1156  *
1157  */
1158 typedef npy_double __pyx_t_5numpy_double_t;
1159 
1160 /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":813
1161  * ctypedef npy_double float_t
1162  * ctypedef npy_double double_t
1163  * ctypedef npy_longdouble longdouble_t # <<<<<<<<<<<<<<
1164  *
1165  * ctypedef npy_cfloat cfloat_t
1166  */
1167 typedef npy_longdouble __pyx_t_5numpy_longdouble_t;
1168 /* Declarations.proto */
1169 #if CYTHON_CCOMPLEX
1170  #ifdef __cplusplus
1171  typedef ::std::complex< float > __pyx_t_float_complex;
1172  #else
1173  typedef float _Complex __pyx_t_float_complex;
1174  #endif
1175 #else
1176  typedef struct { float real, imag; } __pyx_t_float_complex;
1177 #endif
1178 static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float, float);
1179 
1180 /* Declarations.proto */
1181 #if CYTHON_CCOMPLEX
1182  #ifdef __cplusplus
1183  typedef ::std::complex< double > __pyx_t_double_complex;
1184  #else
1185  typedef double _Complex __pyx_t_double_complex;
1186  #endif
1187 #else
1188  typedef struct { double real, imag; } __pyx_t_double_complex;
1189 #endif
1190 static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double, double);
1191 
1192 
1193 /*--- Type declarations ---*/
1194 struct PyMPIStatusObject;
1195 struct PyMPIDatatypeObject;
1196 struct PyMPIRequestObject;
1197 struct PyMPIPrequestObject;
1198 struct PyMPIGrequestObject;
1199 struct PyMPIMessageObject;
1200 struct PyMPIOpObject;
1201 struct PyMPIGroupObject;
1202 struct PyMPIInfoObject;
1203 struct PyMPIErrhandlerObject;
1204 struct PyMPICommObject;
1205 struct PyMPIIntracommObject;
1206 struct PyMPITopocommObject;
1207 struct PyMPICartcommObject;
1208 struct PyMPIGraphcommObject;
1209 struct PyMPIDistgraphcommObject;
1210 struct PyMPIIntercommObject;
1211 struct PyMPIWinObject;
1212 struct PyMPIFileObject;
1213 struct __pyx_obj_7proteus_10cmeshTools_CMesh;
1214 struct __pyx_array_obj;
1215 struct __pyx_MemviewEnum_obj;
1216 struct __pyx_memoryview_obj;
1217 struct __pyx_memoryviewslice_obj;
1218 
1219 /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":815
1220  * ctypedef npy_longdouble longdouble_t
1221  *
1222  * ctypedef npy_cfloat cfloat_t # <<<<<<<<<<<<<<
1223  * ctypedef npy_cdouble cdouble_t
1224  * ctypedef npy_clongdouble clongdouble_t
1225  */
1226 typedef npy_cfloat __pyx_t_5numpy_cfloat_t;
1227 
1228 /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":816
1229  *
1230  * ctypedef npy_cfloat cfloat_t
1231  * ctypedef npy_cdouble cdouble_t # <<<<<<<<<<<<<<
1232  * ctypedef npy_clongdouble clongdouble_t
1233  *
1234  */
1235 typedef npy_cdouble __pyx_t_5numpy_cdouble_t;
1236 
1237 /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":817
1238  * ctypedef npy_cfloat cfloat_t
1239  * ctypedef npy_cdouble cdouble_t
1240  * ctypedef npy_clongdouble clongdouble_t # <<<<<<<<<<<<<<
1241  *
1242  * ctypedef npy_cdouble complex_t
1243  */
1244 typedef npy_clongdouble __pyx_t_5numpy_clongdouble_t;
1245 
1246 /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":819
1247  * ctypedef npy_clongdouble clongdouble_t
1248  *
1249  * ctypedef npy_cdouble complex_t # <<<<<<<<<<<<<<
1250  *
1251  * cdef inline object PyArray_MultiIterNew1(a):
1252  */
1253 typedef npy_cdouble __pyx_t_5numpy_complex_t;
1254 
1255 /* "mpi4py/MPI.pxd":28
1256  * ctypedef MPI_Count Count "MPI_Count"
1257  *
1258  * ctypedef public api class Status [ # <<<<<<<<<<<<<<
1259  * type PyMPIStatus_Type,
1260  * object PyMPIStatusObject,
1261  */
1262 struct PyMPIStatusObject {
1263  PyObject_HEAD
1264  MPI_Status ob_mpi;
1265  unsigned int flags;
1266 };
1267 typedef struct PyMPIStatusObject PyMPIStatusObject;
1268 
1269 __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyMPIStatus_Type;
1270 
1271 /* "mpi4py/MPI.pxd":35
1272  * cdef unsigned flags
1273  *
1274  * ctypedef public api class Datatype [ # <<<<<<<<<<<<<<
1275  * type PyMPIDatatype_Type,
1276  * object PyMPIDatatypeObject,
1277  */
1278 struct PyMPIDatatypeObject {
1279  PyObject_HEAD
1280  MPI_Datatype ob_mpi;
1281  unsigned int flags;
1282 };
1283 typedef struct PyMPIDatatypeObject PyMPIDatatypeObject;
1284 
1285 __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyMPIDatatype_Type;
1286 
1287 /* "mpi4py/MPI.pxd":42
1288  * cdef unsigned flags
1289  *
1290  * ctypedef public api class Request [ # <<<<<<<<<<<<<<
1291  * type PyMPIRequest_Type,
1292  * object PyMPIRequestObject,
1293  */
1294 struct PyMPIRequestObject {
1295  PyObject_HEAD
1296  MPI_Request ob_mpi;
1297  unsigned int flags;
1298  PyObject *ob_buf;
1299 };
1300 typedef struct PyMPIRequestObject PyMPIRequestObject;
1301 
1302 __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyMPIRequest_Type;
1303 
1304 /* "mpi4py/MPI.pxd":50
1305  * cdef object ob_buf
1306  *
1307  * ctypedef public api class Prequest(Request) [ # <<<<<<<<<<<<<<
1308  * type PyMPIPrequest_Type,
1309  * object PyMPIPrequestObject,
1310  */
1311 struct PyMPIPrequestObject {
1312  struct PyMPIRequestObject __pyx_base;
1313 };
1314 typedef struct PyMPIPrequestObject PyMPIPrequestObject;
1315 
1316 __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyMPIPrequest_Type;
1317 
1318 /* "mpi4py/MPI.pxd":56
1319  * pass
1320  *
1321  * ctypedef public api class Grequest(Request) [ # <<<<<<<<<<<<<<
1322  * type PyMPIGrequest_Type,
1323  * object PyMPIGrequestObject,
1324  */
1325 struct PyMPIGrequestObject {
1326  struct PyMPIRequestObject __pyx_base;
1327  MPI_Request ob_grequest;
1328 };
1329 typedef struct PyMPIGrequestObject PyMPIGrequestObject;
1330 
1331 __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyMPIGrequest_Type;
1332 
1333 /* "mpi4py/MPI.pxd":62
1334  * cdef MPI_Request ob_grequest
1335  *
1336  * ctypedef public api class Message [ # <<<<<<<<<<<<<<
1337  * type PyMPIMessage_Type,
1338  * object PyMPIMessageObject,
1339  */
1340 struct PyMPIMessageObject {
1341  PyObject_HEAD
1342  MPI_Message ob_mpi;
1343  unsigned int flags;
1344  PyObject *ob_buf;
1345 };
1346 typedef struct PyMPIMessageObject PyMPIMessageObject;
1347 
1348 __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyMPIMessage_Type;
1349 
1350 /* "mpi4py/MPI.pxd":70
1351  * cdef object ob_buf
1352  *
1353  * ctypedef public api class Op [ # <<<<<<<<<<<<<<
1354  * type PyMPIOp_Type,
1355  * object PyMPIOpObject,
1356  */
1357 struct PyMPIOpObject {
1358  PyObject_HEAD
1359  MPI_Op ob_mpi;
1360  unsigned int flags;
1361  PyObject *(*ob_func)(PyObject *, PyObject *);
1362  int ob_usrid;
1363 };
1364 typedef struct PyMPIOpObject PyMPIOpObject;
1365 
1366 __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyMPIOp_Type;
1367 
1368 /* "mpi4py/MPI.pxd":79
1369  * cdef int ob_usrid
1370  *
1371  * ctypedef public api class Group [ # <<<<<<<<<<<<<<
1372  * type PyMPIGroup_Type,
1373  * object PyMPIGroupObject,
1374  */
1375 struct PyMPIGroupObject {
1376  PyObject_HEAD
1377  MPI_Group ob_mpi;
1378  unsigned int flags;
1379 };
1380 typedef struct PyMPIGroupObject PyMPIGroupObject;
1381 
1382 __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyMPIGroup_Type;
1383 
1384 /* "mpi4py/MPI.pxd":86
1385  * cdef unsigned flags
1386  *
1387  * ctypedef public api class Info [ # <<<<<<<<<<<<<<
1388  * type PyMPIInfo_Type,
1389  * object PyMPIInfoObject,
1390  */
1391 struct PyMPIInfoObject {
1392  PyObject_HEAD
1393  MPI_Info ob_mpi;
1394  unsigned int flags;
1395 };
1396 typedef struct PyMPIInfoObject PyMPIInfoObject;
1397 
1398 __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyMPIInfo_Type;
1399 
1400 /* "mpi4py/MPI.pxd":93
1401  * cdef unsigned flags
1402  *
1403  * ctypedef public api class Errhandler [ # <<<<<<<<<<<<<<
1404  * type PyMPIErrhandler_Type,
1405  * object PyMPIErrhandlerObject,
1406  */
1407 struct PyMPIErrhandlerObject {
1408  PyObject_HEAD
1409  MPI_Errhandler ob_mpi;
1410  unsigned int flags;
1411 };
1412 typedef struct PyMPIErrhandlerObject PyMPIErrhandlerObject;
1413 
1414 __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyMPIErrhandler_Type;
1415 
1416 /* "mpi4py/MPI.pxd":100
1417  * cdef unsigned flags
1418  *
1419  * ctypedef public api class Comm [ # <<<<<<<<<<<<<<
1420  * type PyMPIComm_Type,
1421  * object PyMPICommObject,
1422  */
1423 struct PyMPICommObject {
1424  PyObject_HEAD
1425  MPI_Comm ob_mpi;
1426  unsigned int flags;
1427 };
1428 typedef struct PyMPICommObject PyMPICommObject;
1429 
1430 __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyMPIComm_Type;
1431 
1432 /* "mpi4py/MPI.pxd":107
1433  * cdef unsigned flags
1434  *
1435  * ctypedef public api class Intracomm(Comm) [ # <<<<<<<<<<<<<<
1436  * type PyMPIIntracomm_Type,
1437  * object PyMPIIntracommObject,
1438  */
1439 struct PyMPIIntracommObject {
1440  struct PyMPICommObject __pyx_base;
1441 };
1442 typedef struct PyMPIIntracommObject PyMPIIntracommObject;
1443 
1444 __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyMPIIntracomm_Type;
1445 
1446 /* "mpi4py/MPI.pxd":113
1447  * pass
1448  *
1449  * ctypedef public api class Topocomm(Intracomm) [ # <<<<<<<<<<<<<<
1450  * type PyMPITopocomm_Type,
1451  * object PyMPITopocommObject,
1452  */
1453 struct PyMPITopocommObject {
1454  struct PyMPIIntracommObject __pyx_base;
1455 };
1456 typedef struct PyMPITopocommObject PyMPITopocommObject;
1457 
1458 __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyMPITopocomm_Type;
1459 
1460 /* "mpi4py/MPI.pxd":119
1461  * pass
1462  *
1463  * ctypedef public api class Cartcomm(Topocomm) [ # <<<<<<<<<<<<<<
1464  * type PyMPICartcomm_Type,
1465  * object PyMPICartcommObject,
1466  */
1467 struct PyMPICartcommObject {
1468  struct PyMPITopocommObject __pyx_base;
1469 };
1470 typedef struct PyMPICartcommObject PyMPICartcommObject;
1471 
1472 __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyMPICartcomm_Type;
1473 
1474 /* "mpi4py/MPI.pxd":125
1475  * pass
1476  *
1477  * ctypedef public api class Graphcomm(Topocomm) [ # <<<<<<<<<<<<<<
1478  * type PyMPIGraphcomm_Type,
1479  * object PyMPIGraphcommObject,
1480  */
1481 struct PyMPIGraphcommObject {
1482  struct PyMPITopocommObject __pyx_base;
1483 };
1484 typedef struct PyMPIGraphcommObject PyMPIGraphcommObject;
1485 
1486 __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyMPIGraphcomm_Type;
1487 
1488 /* "mpi4py/MPI.pxd":131
1489  * pass
1490  *
1491  * ctypedef public api class Distgraphcomm(Topocomm) [ # <<<<<<<<<<<<<<
1492  * type PyMPIDistgraphcomm_Type,
1493  * object PyMPIDistgraphcommObject,
1494  */
1495 struct PyMPIDistgraphcommObject {
1496  struct PyMPITopocommObject __pyx_base;
1497 };
1498 typedef struct PyMPIDistgraphcommObject PyMPIDistgraphcommObject;
1499 
1500 __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyMPIDistgraphcomm_Type;
1501 
1502 /* "mpi4py/MPI.pxd":137
1503  * pass
1504  *
1505  * ctypedef public api class Intercomm(Comm) [ # <<<<<<<<<<<<<<
1506  * type PyMPIIntercomm_Type,
1507  * object PyMPIIntercommObject,
1508  */
1509 struct PyMPIIntercommObject {
1510  struct PyMPICommObject __pyx_base;
1511 };
1512 typedef struct PyMPIIntercommObject PyMPIIntercommObject;
1513 
1514 __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyMPIIntercomm_Type;
1515 
1516 /* "mpi4py/MPI.pxd":143
1517  * pass
1518  *
1519  * ctypedef public api class Win [ # <<<<<<<<<<<<<<
1520  * type PyMPIWin_Type,
1521  * object PyMPIWinObject,
1522  */
1523 struct PyMPIWinObject {
1524  PyObject_HEAD
1525  MPI_Win ob_mpi;
1526  unsigned int flags;
1527  PyObject *ob_mem;
1528 };
1529 typedef struct PyMPIWinObject PyMPIWinObject;
1530 
1531 __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyMPIWin_Type;
1532 
1533 /* "mpi4py/MPI.pxd":151
1534  * cdef object ob_mem
1535  *
1536  * ctypedef public api class File [ # <<<<<<<<<<<<<<
1537  * type PyMPIFile_Type,
1538  * object PyMPIFileObject,
1539  */
1540 struct PyMPIFileObject {
1541  PyObject_HEAD
1542  MPI_File ob_mpi;
1543  unsigned int flags;
1544 };
1545 typedef struct PyMPIFileObject PyMPIFileObject;
1546 
1547 __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyMPIFile_Type;
1548 
1549 /* "cmeshTools.pxd":5
1550  * cimport mesh as cppm
1551  *
1552  * cdef class CMesh: # <<<<<<<<<<<<<<
1553  * cdef cppm.Mesh mesh
1554  * cdef public:
1555  */
1556 struct __pyx_obj_7proteus_10cmeshTools_CMesh {
1557  PyObject_HEAD
1558  struct Mesh mesh;
1559  int nElements_global;
1560  int nNodes_global;
1561  int nNodes_element;
1567  int max_nElements_node;
1568  int nEdges_global;
1570  PyArrayObject *elementNodesArray;
1571  PyArrayObject *nodeElementsArray;
1572  PyArrayObject *nodeElementOffsets;
1573  PyArrayObject *elementNeighborsArray;
1574  PyArrayObject *elementBoundariesArray;
1575  PyArrayObject *elementBoundaryNodesArray;
1576  PyArrayObject *elementBoundaryElementsArray;
1578  PyArrayObject *interiorElementBoundariesArray;
1579  PyArrayObject *exteriorElementBoundariesArray;
1580  PyArrayObject *edgeNodesArray;
1581  PyArrayObject *nodeStarArray;
1582  PyArrayObject *nodeStarOffsets;
1583  PyArrayObject *elementMaterialTypes;
1584  PyArrayObject *elementBoundaryMaterialTypes;
1585  PyArrayObject *nodeMaterialTypes;
1586  PyArrayObject *nodeArray;
1587  int nx;
1588  int ny;
1589  int nz;
1590  int px;
1591  int py;
1592  int pz;
1593  PyArrayObject *elementIJK;
1594  PyArrayObject *weights;
1595  PyArrayObject *U_KNOT;
1596  PyArrayObject *V_KNOT;
1597  PyArrayObject *W_KNOT;
1598  PyArrayObject *elementDiametersArray;
1599  PyArrayObject *elementInnerDiametersArray;
1600  PyArrayObject *elementBoundaryDiametersArray;
1601  PyArrayObject *elementBarycentersArray;
1602  PyArrayObject *elementBoundaryBarycentersArray;
1603  PyArrayObject *nodeDiametersArray;
1604  PyArrayObject *nodeSupportArray;
1605  double h;
1606  double hMin;
1607  double sigmaMax;
1608  double volume;
1609 };
1610 
1611 
1612 /* "View.MemoryView":105
1613  *
1614  * @cname("__pyx_array")
1615  * cdef class array: # <<<<<<<<<<<<<<
1616  *
1617  * cdef:
1618  */
1619 struct __pyx_array_obj {
1620  PyObject_HEAD
1621  struct __pyx_vtabstruct_array *__pyx_vtab;
1622  char *data;
1623  Py_ssize_t len;
1624  char *format;
1625  int ndim;
1626  Py_ssize_t *_shape;
1627  Py_ssize_t *_strides;
1628  Py_ssize_t itemsize;
1629  PyObject *mode;
1630  PyObject *_format;
1631  void (*callback_free_data)(void *);
1632  int free_data;
1633  int dtype_is_object;
1634 };
1635 
1636 
1637 /* "View.MemoryView":279
1638  *
1639  * @cname('__pyx_MemviewEnum')
1640  * cdef class Enum(object): # <<<<<<<<<<<<<<
1641  * cdef object name
1642  * def __init__(self, name):
1643  */
1644 struct __pyx_MemviewEnum_obj {
1645  PyObject_HEAD
1646  PyObject *name;
1647 };
1648 
1649 
1650 /* "View.MemoryView":330
1651  *
1652  * @cname('__pyx_memoryview')
1653  * cdef class memoryview(object): # <<<<<<<<<<<<<<
1654  *
1655  * cdef object obj
1656  */
1657 struct __pyx_memoryview_obj {
1658  PyObject_HEAD
1659  struct __pyx_vtabstruct_memoryview *__pyx_vtab;
1660  PyObject *obj;
1661  PyObject *_size;
1662  PyObject *_array_interface;
1663  PyThread_type_lock lock;
1664  __pyx_atomic_int acquisition_count[2];
1665  __pyx_atomic_int *acquisition_count_aligned_p;
1666  Py_buffer view;
1667  int flags;
1668  int dtype_is_object;
1669  __Pyx_TypeInfo *typeinfo;
1670 };
1671 
1672 
1673 /* "View.MemoryView":961
1674  *
1675  * @cname('__pyx_memoryviewslice')
1676  * cdef class _memoryviewslice(memoryview): # <<<<<<<<<<<<<<
1677  * "Internal class for passing memoryview slices to Python"
1678  *
1679  */
1680 struct __pyx_memoryviewslice_obj {
1681  struct __pyx_memoryview_obj __pyx_base;
1682  __Pyx_memviewslice from_slice;
1683  PyObject *from_object;
1684  PyObject *(*to_object_func)(char *);
1685  int (*to_dtype_func)(char *, PyObject *);
1686 };
1687 
1688 
1689 
1690 /* "View.MemoryView":105
1691  *
1692  * @cname("__pyx_array")
1693  * cdef class array: # <<<<<<<<<<<<<<
1694  *
1695  * cdef:
1696  */
1697 
1698 struct __pyx_vtabstruct_array {
1699  PyObject *(*get_memview)(struct __pyx_array_obj *);
1700 };
1701 static struct __pyx_vtabstruct_array *__pyx_vtabptr_array;
1702 
1703 
1704 /* "View.MemoryView":330
1705  *
1706  * @cname('__pyx_memoryview')
1707  * cdef class memoryview(object): # <<<<<<<<<<<<<<
1708  *
1709  * cdef object obj
1710  */
1711 
1712 struct __pyx_vtabstruct_memoryview {
1713  char *(*get_item_pointer)(struct __pyx_memoryview_obj *, PyObject *);
1714  PyObject *(*is_slice)(struct __pyx_memoryview_obj *, PyObject *);
1715  PyObject *(*setitem_slice_assignment)(struct __pyx_memoryview_obj *, PyObject *, PyObject *);
1716  PyObject *(*setitem_slice_assign_scalar)(struct __pyx_memoryview_obj *, struct __pyx_memoryview_obj *, PyObject *);
1717  PyObject *(*setitem_indexed)(struct __pyx_memoryview_obj *, PyObject *, PyObject *);
1718  PyObject *(*convert_item_to_object)(struct __pyx_memoryview_obj *, char *);
1719  PyObject *(*assign_item_from_object)(struct __pyx_memoryview_obj *, char *, PyObject *);
1720 };
1721 static struct __pyx_vtabstruct_memoryview *__pyx_vtabptr_memoryview;
1722 
1723 
1724 /* "View.MemoryView":961
1725  *
1726  * @cname('__pyx_memoryviewslice')
1727  * cdef class _memoryviewslice(memoryview): # <<<<<<<<<<<<<<
1728  * "Internal class for passing memoryview slices to Python"
1729  *
1730  */
1731 
1732 struct __pyx_vtabstruct__memoryviewslice {
1733  struct __pyx_vtabstruct_memoryview __pyx_base;
1734 };
1735 static struct __pyx_vtabstruct__memoryviewslice *__pyx_vtabptr__memoryviewslice;
1736 
1737 /* --- Runtime support code (head) --- */
1738 /* Refnanny.proto */
1739 #ifndef CYTHON_REFNANNY
1740  #define CYTHON_REFNANNY 0
1741 #endif
1742 #if CYTHON_REFNANNY
1743  typedef struct {
1744  void (*INCREF)(void*, PyObject*, int);
1745  void (*DECREF)(void*, PyObject*, int);
1746  void (*GOTREF)(void*, PyObject*, int);
1747  void (*GIVEREF)(void*, PyObject*, int);
1748  void* (*SetupContext)(const char*, int, const char*);
1749  void (*FinishContext)(void**);
1750  } __Pyx_RefNannyAPIStruct;
1751  static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL;
1752  static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname);
1753  #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL;
1754 #ifdef WITH_THREAD
1755  #define __Pyx_RefNannySetupContext(name, acquire_gil)\
1756  if (acquire_gil) {\
1757  PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\
1758  __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\
1759  PyGILState_Release(__pyx_gilstate_save);\
1760  } else {\
1761  __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\
1762  }
1763 #else
1764  #define __Pyx_RefNannySetupContext(name, acquire_gil)\
1765  __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__)
1766 #endif
1767  #define __Pyx_RefNannyFinishContext()\
1768  __Pyx_RefNanny->FinishContext(&__pyx_refnanny)
1769  #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1770  #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1771  #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1772  #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1773  #define __Pyx_XINCREF(r) do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0)
1774  #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0)
1775  #define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0)
1776  #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0)
1777 #else
1778  #define __Pyx_RefNannyDeclarations
1779  #define __Pyx_RefNannySetupContext(name, acquire_gil)
1780  #define __Pyx_RefNannyFinishContext()
1781  #define __Pyx_INCREF(r) Py_INCREF(r)
1782  #define __Pyx_DECREF(r) Py_DECREF(r)
1783  #define __Pyx_GOTREF(r)
1784  #define __Pyx_GIVEREF(r)
1785  #define __Pyx_XINCREF(r) Py_XINCREF(r)
1786  #define __Pyx_XDECREF(r) Py_XDECREF(r)
1787  #define __Pyx_XGOTREF(r)
1788  #define __Pyx_XGIVEREF(r)
1789 #endif
1790 #define __Pyx_XDECREF_SET(r, v) do {\
1791  PyObject *tmp = (PyObject *) r;\
1792  r = v; __Pyx_XDECREF(tmp);\
1793  } while (0)
1794 #define __Pyx_DECREF_SET(r, v) do {\
1795  PyObject *tmp = (PyObject *) r;\
1796  r = v; __Pyx_DECREF(tmp);\
1797  } while (0)
1798 #define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0)
1799 #define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0)
1800 
1801 /* RaiseArgTupleInvalid.proto */
1802 static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact,
1803  Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found);
1804 
1805 /* RaiseDoubleKeywords.proto */
1806 static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name);
1807 
1808 /* ParseKeywords.proto */
1809 static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[],\
1810  PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,\
1811  const char* function_name);
1812 
1813 /* ArgTypeTest.proto */
1814 #define __Pyx_ArgTypeTest(obj, type, none_allowed, name, exact)\
1815  ((likely((Py_TYPE(obj) == type) | (none_allowed && (obj == Py_None)))) ? 1 :\
1816  __Pyx__ArgTypeTest(obj, type, name, exact))
1817 static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact);
1818 
1819 /* PyObjectGetAttrStr.proto */
1820 #if CYTHON_USE_TYPE_SLOTS
1821 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name);
1822 #else
1823 #define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n)
1824 #endif
1825 
1826 /* GetBuiltinName.proto */
1827 static PyObject *__Pyx_GetBuiltinName(PyObject *name);
1828 
1829 /* GetModuleGlobalName.proto */
1830 #if CYTHON_USE_DICT_VERSIONS
1831 #define __Pyx_GetModuleGlobalName(var, name) {\
1832  static PY_UINT64_T __pyx_dict_version = 0;\
1833  static PyObject *__pyx_dict_cached_value = NULL;\
1834  (var) = (likely(__pyx_dict_version == __PYX_GET_DICT_VERSION(__pyx_d))) ?\
1835  (likely(__pyx_dict_cached_value) ? __Pyx_NewRef(__pyx_dict_cached_value) : __Pyx_GetBuiltinName(name)) :\
1836  __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\
1837 }
1838 #define __Pyx_GetModuleGlobalNameUncached(var, name) {\
1839  PY_UINT64_T __pyx_dict_version;\
1840  PyObject *__pyx_dict_cached_value;\
1841  (var) = __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\
1842 }
1843 static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value);
1844 #else
1845 #define __Pyx_GetModuleGlobalName(var, name) (var) = __Pyx__GetModuleGlobalName(name)
1846 #define __Pyx_GetModuleGlobalNameUncached(var, name) (var) = __Pyx__GetModuleGlobalName(name)
1847 static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name);
1848 #endif
1849 
1850 /* PyIntBinop.proto */
1851 #if !CYTHON_COMPILING_IN_PYPY
1852 static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, long intval, int inplace);
1853 #else
1854 #define __Pyx_PyInt_AddObjC(op1, op2, intval, inplace)\
1855  (inplace ? PyNumber_InPlaceAdd(op1, op2) : PyNumber_Add(op1, op2))
1856 #endif
1857 
1858 /* PyCFunctionFastCall.proto */
1859 #if CYTHON_FAST_PYCCALL
1860 static CYTHON_INLINE PyObject *__Pyx_PyCFunction_FastCall(PyObject *func, PyObject **args, Py_ssize_t nargs);
1861 #else
1862 #define __Pyx_PyCFunction_FastCall(func, args, nargs) (assert(0), NULL)
1863 #endif
1864 
1865 /* PyFunctionFastCall.proto */
1866 #if CYTHON_FAST_PYCALL
1867 #define __Pyx_PyFunction_FastCall(func, args, nargs)\
1868  __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL)
1869 #if 1 || PY_VERSION_HEX < 0x030600B1
1870 static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, int nargs, PyObject *kwargs);
1871 #else
1872 #define __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs) _PyFunction_FastCallDict(func, args, nargs, kwargs)
1873 #endif
1874 #define __Pyx_BUILD_ASSERT_EXPR(cond)\
1875  (sizeof(char [1 - 2*!(cond)]) - 1)
1876 #ifndef Py_MEMBER_SIZE
1877 #define Py_MEMBER_SIZE(type, member) sizeof(((type *)0)->member)
1878 #endif
1879  static size_t __pyx_pyframe_localsplus_offset = 0;
1880  #include "frameobject.h"
1881  #define __Pxy_PyFrame_Initialize_Offsets()\
1882  ((void)__Pyx_BUILD_ASSERT_EXPR(sizeof(PyFrameObject) == offsetof(PyFrameObject, f_localsplus) + Py_MEMBER_SIZE(PyFrameObject, f_localsplus)),\
1883  (void)(__pyx_pyframe_localsplus_offset = ((size_t)PyFrame_Type.tp_basicsize) - Py_MEMBER_SIZE(PyFrameObject, f_localsplus)))
1884  #define __Pyx_PyFrame_GetLocalsplus(frame)\
1885  (assert(__pyx_pyframe_localsplus_offset), (PyObject **)(((char *)(frame)) + __pyx_pyframe_localsplus_offset))
1886 #endif
1887 
1888 /* PyObjectCall.proto */
1889 #if CYTHON_COMPILING_IN_CPYTHON
1890 static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw);
1891 #else
1892 #define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw)
1893 #endif
1894 
1895 /* PyObjectCall2Args.proto */
1896 static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2);
1897 
1898 /* PyObjectCallMethO.proto */
1899 #if CYTHON_COMPILING_IN_CPYTHON
1900 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg);
1901 #endif
1902 
1903 /* PyObjectCallOneArg.proto */
1904 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg);
1905 
1906 /* PyObjectCallNoArg.proto */
1907 #if CYTHON_COMPILING_IN_CPYTHON
1908 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func);
1909 #else
1910 #define __Pyx_PyObject_CallNoArg(func) __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL)
1911 #endif
1912 
1913 /* PyThreadStateGet.proto */
1914 #if CYTHON_FAST_THREAD_STATE
1915 #define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate;
1916 #define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current;
1917 #define __Pyx_PyErr_Occurred() __pyx_tstate->curexc_type
1918 #else
1919 #define __Pyx_PyThreadState_declare
1920 #define __Pyx_PyThreadState_assign
1921 #define __Pyx_PyErr_Occurred() PyErr_Occurred()
1922 #endif
1923 
1924 /* PyErrFetchRestore.proto */
1925 #if CYTHON_FAST_THREAD_STATE
1926 #define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL)
1927 #define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb)
1928 #define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb)
1929 #define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb)
1930 #define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb)
1931 static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
1932 static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1933 #if CYTHON_COMPILING_IN_CPYTHON
1934 #define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL))
1935 #else
1936 #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
1937 #endif
1938 #else
1939 #define __Pyx_PyErr_Clear() PyErr_Clear()
1940 #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
1941 #define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb)
1942 #define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb)
1943 #define __Pyx_ErrRestoreInState(tstate, type, value, tb) PyErr_Restore(type, value, tb)
1944 #define __Pyx_ErrFetchInState(tstate, type, value, tb) PyErr_Fetch(type, value, tb)
1945 #define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb)
1946 #define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb)
1947 #endif
1948 
1949 /* RaiseException.proto */
1950 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause);
1951 
1952 /* DictGetItem.proto */
1953 #if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY
1954 static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key);
1955 #define __Pyx_PyObject_Dict_GetItem(obj, name)\
1956  (likely(PyDict_CheckExact(obj)) ?\
1957  __Pyx_PyDict_GetItem(obj, name) : PyObject_GetItem(obj, name))
1958 #else
1959 #define __Pyx_PyDict_GetItem(d, key) PyObject_GetItem(d, key)
1960 #define __Pyx_PyObject_Dict_GetItem(obj, name) PyObject_GetItem(obj, name)
1961 #endif
1962 
1963 /* RaiseTooManyValuesToUnpack.proto */
1964 static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected);
1965 
1966 /* RaiseNeedMoreValuesToUnpack.proto */
1967 static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index);
1968 
1969 /* RaiseNoneIterError.proto */
1970 static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void);
1971 
1972 /* ExtTypeTest.proto */
1973 static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type);
1974 
1975 /* GetTopmostException.proto */
1976 #if CYTHON_USE_EXC_INFO_STACK
1977 static _PyErr_StackItem * __Pyx_PyErr_GetTopmostException(PyThreadState *tstate);
1978 #endif
1979 
1980 /* SaveResetException.proto */
1981 #if CYTHON_FAST_THREAD_STATE
1982 #define __Pyx_ExceptionSave(type, value, tb) __Pyx__ExceptionSave(__pyx_tstate, type, value, tb)
1983 static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1984 #define __Pyx_ExceptionReset(type, value, tb) __Pyx__ExceptionReset(__pyx_tstate, type, value, tb)
1985 static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
1986 #else
1987 #define __Pyx_ExceptionSave(type, value, tb) PyErr_GetExcInfo(type, value, tb)
1988 #define __Pyx_ExceptionReset(type, value, tb) PyErr_SetExcInfo(type, value, tb)
1989 #endif
1990 
1991 /* PyErrExceptionMatches.proto */
1992 #if CYTHON_FAST_THREAD_STATE
1993 #define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err)
1994 static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err);
1995 #else
1996 #define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err)
1997 #endif
1998 
1999 /* GetException.proto */
2000 #if CYTHON_FAST_THREAD_STATE
2001 #define __Pyx_GetException(type, value, tb) __Pyx__GetException(__pyx_tstate, type, value, tb)
2002 static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
2003 #else
2004 static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb);
2005 #endif
2006 
2007 /* IncludeStringH.proto */
2008 #include <string.h>
2009 
2010 /* BytesEquals.proto */
2011 static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals);
2012 
2013 /* UnicodeEquals.proto */
2014 static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals);
2015 
2016 /* StrEquals.proto */
2017 #if PY_MAJOR_VERSION >= 3
2018 #define __Pyx_PyString_Equals __Pyx_PyUnicode_Equals
2019 #else
2020 #define __Pyx_PyString_Equals __Pyx_PyBytes_Equals
2021 #endif
2022 
2023 /* None.proto */
2024 static CYTHON_INLINE Py_ssize_t __Pyx_div_Py_ssize_t(Py_ssize_t, Py_ssize_t);
2025 
2026 /* UnaryNegOverflows.proto */
2027 #define UNARY_NEG_WOULD_OVERFLOW(x)\
2028  (((x) < 0) & ((unsigned long)(x) == 0-(unsigned long)(x)))
2029 
2030 static CYTHON_UNUSED int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
2031 static PyObject *__pyx_array_get_memview(struct __pyx_array_obj *); /*proto*/
2032 /* GetAttr.proto */
2033 static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *, PyObject *);
2034 
2035 /* GetItemInt.proto */
2036 #define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
2037  (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
2038  __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) :\
2039  (is_list ? (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL) :\
2040  __Pyx_GetItemInt_Generic(o, to_py_func(i))))
2041 #define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
2042  (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
2043  __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\
2044  (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL))
2045 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
2046  int wraparound, int boundscheck);
2047 #define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
2048  (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
2049  __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\
2050  (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL))
2051 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
2052  int wraparound, int boundscheck);
2053 static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j);
2054 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i,
2055  int is_list, int wraparound, int boundscheck);
2056 
2057 /* ObjectGetItem.proto */
2058 #if CYTHON_USE_TYPE_SLOTS
2059 static CYTHON_INLINE PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject* key);
2060 #else
2061 #define __Pyx_PyObject_GetItem(obj, key) PyObject_GetItem(obj, key)
2062 #endif
2063 
2064 /* decode_c_string_utf16.proto */
2065 static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16(const char *s, Py_ssize_t size, const char *errors) {
2066  int byteorder = 0;
2067  return PyUnicode_DecodeUTF16(s, size, errors, &byteorder);
2068 }
2069 static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16LE(const char *s, Py_ssize_t size, const char *errors) {
2070  int byteorder = -1;
2071  return PyUnicode_DecodeUTF16(s, size, errors, &byteorder);
2072 }
2073 static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16BE(const char *s, Py_ssize_t size, const char *errors) {
2074  int byteorder = 1;
2075  return PyUnicode_DecodeUTF16(s, size, errors, &byteorder);
2076 }
2077 
2078 /* decode_c_string.proto */
2079 static CYTHON_INLINE PyObject* __Pyx_decode_c_string(
2080  const char* cstring, Py_ssize_t start, Py_ssize_t stop,
2081  const char* encoding, const char* errors,
2082  PyObject* (*decode_func)(const char *s, Py_ssize_t size, const char *errors));
2083 
2084 /* GetAttr3.proto */
2085 static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *, PyObject *, PyObject *);
2086 
2087 /* SwapException.proto */
2088 #if CYTHON_FAST_THREAD_STATE
2089 #define __Pyx_ExceptionSwap(type, value, tb) __Pyx__ExceptionSwap(__pyx_tstate, type, value, tb)
2090 static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
2091 #else
2092 static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb);
2093 #endif
2094 
2095 /* Import.proto */
2096 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level);
2097 
2098 /* FastTypeChecks.proto */
2099 #if CYTHON_COMPILING_IN_CPYTHON
2100 #define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type)
2101 static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b);
2102 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type);
2103 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2);
2104 #else
2105 #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)
2106 #define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type)
2107 #define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2))
2108 #endif
2109 #define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception)
2110 
2111 static CYTHON_UNUSED int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
2112 /* ListCompAppend.proto */
2113 #if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS
2114 static CYTHON_INLINE int __Pyx_ListComp_Append(PyObject* list, PyObject* x) {
2115  PyListObject* L = (PyListObject*) list;
2116  Py_ssize_t len = Py_SIZE(list);
2117  if (likely(L->allocated > len)) {
2118  Py_INCREF(x);
2119  PyList_SET_ITEM(list, len, x);
2120  Py_SIZE(list) = len+1;
2121  return 0;
2122  }
2123  return PyList_Append(list, x);
2124 }
2125 #else
2126 #define __Pyx_ListComp_Append(L,x) PyList_Append(L,x)
2127 #endif
2128 
2129 /* ListExtend.proto */
2130 static CYTHON_INLINE int __Pyx_PyList_Extend(PyObject* L, PyObject* v) {
2131 #if CYTHON_COMPILING_IN_CPYTHON
2132  PyObject* none = _PyList_Extend((PyListObject*)L, v);
2133  if (unlikely(!none))
2134  return -1;
2135  Py_DECREF(none);
2136  return 0;
2137 #else
2138  return PyList_SetSlice(L, PY_SSIZE_T_MAX, PY_SSIZE_T_MAX, v);
2139 #endif
2140 }
2141 
2142 /* ListAppend.proto */
2143 #if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS
2144 static CYTHON_INLINE int __Pyx_PyList_Append(PyObject* list, PyObject* x) {
2145  PyListObject* L = (PyListObject*) list;
2146  Py_ssize_t len = Py_SIZE(list);
2147  if (likely(L->allocated > len) & likely(len > (L->allocated >> 1))) {
2148  Py_INCREF(x);
2149  PyList_SET_ITEM(list, len, x);
2150  Py_SIZE(list) = len+1;
2151  return 0;
2152  }
2153  return PyList_Append(list, x);
2154 }
2155 #else
2156 #define __Pyx_PyList_Append(L,x) PyList_Append(L,x)
2157 #endif
2158 
2159 /* None.proto */
2160 static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname);
2161 
2162 /* None.proto */
2163 static CYTHON_INLINE long __Pyx_div_long(long, long);
2164 
2165 /* WriteUnraisableException.proto */
2166 static void __Pyx_WriteUnraisable(const char *name, int clineno,
2167  int lineno, const char *filename,
2168  int full_traceback, int nogil);
2169 
2170 /* ImportFrom.proto */
2171 static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name);
2172 
2173 /* HasAttr.proto */
2174 static CYTHON_INLINE int __Pyx_HasAttr(PyObject *, PyObject *);
2175 
2176 /* StringJoin.proto */
2177 #if PY_MAJOR_VERSION < 3
2178 #define __Pyx_PyString_Join __Pyx_PyBytes_Join
2179 #define __Pyx_PyBaseString_Join(s, v) (PyUnicode_CheckExact(s) ? PyUnicode_Join(s, v) : __Pyx_PyBytes_Join(s, v))
2180 #else
2181 #define __Pyx_PyString_Join PyUnicode_Join
2182 #define __Pyx_PyBaseString_Join PyUnicode_Join
2183 #endif
2184 #if CYTHON_COMPILING_IN_CPYTHON
2185  #if PY_MAJOR_VERSION < 3
2186  #define __Pyx_PyBytes_Join _PyString_Join
2187  #else
2188  #define __Pyx_PyBytes_Join _PyBytes_Join
2189  #endif
2190 #else
2191 static CYTHON_INLINE PyObject* __Pyx_PyBytes_Join(PyObject* sep, PyObject* values);
2192 #endif
2193 
2194 /* PyObject_Unicode.proto */
2195 #if PY_MAJOR_VERSION >= 3
2196 #define __Pyx_PyObject_Unicode(obj)\
2197  (likely(PyUnicode_CheckExact(obj)) ? __Pyx_NewRef(obj) : PyObject_Str(obj))
2198 #else
2199 #define __Pyx_PyObject_Unicode(obj)\
2200  (likely(PyUnicode_CheckExact(obj)) ? __Pyx_NewRef(obj) : PyObject_Unicode(obj))
2201 #endif
2202 
2203 /* PyObject_GenericGetAttrNoDict.proto */
2204 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
2205 static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name);
2206 #else
2207 #define __Pyx_PyObject_GenericGetAttrNoDict PyObject_GenericGetAttr
2208 #endif
2209 
2210 /* PyObject_GenericGetAttr.proto */
2211 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
2212 static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name);
2213 #else
2214 #define __Pyx_PyObject_GenericGetAttr PyObject_GenericGetAttr
2215 #endif
2216 
2217 /* SetVTable.proto */
2218 static int __Pyx_SetVtable(PyObject *dict, void *vtable);
2219 
2220 /* SetupReduce.proto */
2221 static int __Pyx_setup_reduce(PyObject* type_obj);
2222 
2223 /* TypeImport.proto */
2224 #ifndef __PYX_HAVE_RT_ImportType_proto
2225 #define __PYX_HAVE_RT_ImportType_proto
2226 enum __Pyx_ImportType_CheckSize {
2227  __Pyx_ImportType_CheckSize_Error = 0,
2228  __Pyx_ImportType_CheckSize_Warn = 1,
2229  __Pyx_ImportType_CheckSize_Ignore = 2
2230 };
2231 static PyTypeObject *__Pyx_ImportType(PyObject* module, const char *module_name, const char *class_name, size_t size, enum __Pyx_ImportType_CheckSize check_size);
2232 #endif
2233 
2234 /* CLineInTraceback.proto */
2235 #ifdef CYTHON_CLINE_IN_TRACEBACK
2236 #define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0)
2237 #else
2238 static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line);
2239 #endif
2240 
2241 /* CodeObjectCache.proto */
2242 typedef struct {
2243  PyCodeObject* code_object;
2244  int code_line;
2245 } __Pyx_CodeObjectCacheEntry;
2246 struct __Pyx_CodeObjectCache {
2247  int count;
2248  int max_count;
2249  __Pyx_CodeObjectCacheEntry* entries;
2250 };
2251 static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL};
2252 static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line);
2253 static PyCodeObject *__pyx_find_code_object(int code_line);
2254 static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object);
2255 
2256 /* AddTraceback.proto */
2257 static void __Pyx_AddTraceback(const char *funcname, int c_line,
2258  int py_line, const char *filename);
2259 
2260 /* CIntToPy.proto */
2261 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value);
2262 
2263 /* MemviewDtypeToObject.proto */
2264 static CYTHON_INLINE PyObject *__pyx_memview_get_int(const char *itemp);
2265 static CYTHON_INLINE int __pyx_memview_set_int(const char *itemp, PyObject *obj);
2266 
2267 /* RealImag.proto */
2268 #if CYTHON_CCOMPLEX
2269  #ifdef __cplusplus
2270  #define __Pyx_CREAL(z) ((z).real())
2271  #define __Pyx_CIMAG(z) ((z).imag())
2272  #else
2273  #define __Pyx_CREAL(z) (__real__(z))
2274  #define __Pyx_CIMAG(z) (__imag__(z))
2275  #endif
2276 #else
2277  #define __Pyx_CREAL(z) ((z).real)
2278  #define __Pyx_CIMAG(z) ((z).imag)
2279 #endif
2280 #if defined(__cplusplus) && CYTHON_CCOMPLEX\
2281  && (defined(_WIN32) || defined(__clang__) || (defined(__GNUC__) && (__GNUC__ >= 5 || __GNUC__ == 4 && __GNUC_MINOR__ >= 4 )) || __cplusplus >= 201103)
2282  #define __Pyx_SET_CREAL(z,x) ((z).real(x))
2283  #define __Pyx_SET_CIMAG(z,y) ((z).imag(y))
2284 #else
2285  #define __Pyx_SET_CREAL(z,x) __Pyx_CREAL(z) = (x)
2286  #define __Pyx_SET_CIMAG(z,y) __Pyx_CIMAG(z) = (y)
2287 #endif
2288 
2289 /* Arithmetic.proto */
2290 #if CYTHON_CCOMPLEX
2291  #define __Pyx_c_eq_float(a, b) ((a)==(b))
2292  #define __Pyx_c_sum_float(a, b) ((a)+(b))
2293  #define __Pyx_c_diff_float(a, b) ((a)-(b))
2294  #define __Pyx_c_prod_float(a, b) ((a)*(b))
2295  #define __Pyx_c_quot_float(a, b) ((a)/(b))
2296  #define __Pyx_c_neg_float(a) (-(a))
2297  #ifdef __cplusplus
2298  #define __Pyx_c_is_zero_float(z) ((z)==(float)0)
2299  #define __Pyx_c_conj_float(z) (::std::conj(z))
2300  #if 1
2301  #define __Pyx_c_abs_float(z) (::std::abs(z))
2302  #define __Pyx_c_pow_float(a, b) (::std::pow(a, b))
2303  #endif
2304  #else
2305  #define __Pyx_c_is_zero_float(z) ((z)==0)
2306  #define __Pyx_c_conj_float(z) (conjf(z))
2307  #if 1
2308  #define __Pyx_c_abs_float(z) (cabsf(z))
2309  #define __Pyx_c_pow_float(a, b) (cpowf(a, b))
2310  #endif
2311  #endif
2312 #else
2313  static CYTHON_INLINE int __Pyx_c_eq_float(__pyx_t_float_complex, __pyx_t_float_complex);
2314  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sum_float(__pyx_t_float_complex, __pyx_t_float_complex);
2315  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_diff_float(__pyx_t_float_complex, __pyx_t_float_complex);
2316  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prod_float(__pyx_t_float_complex, __pyx_t_float_complex);
2317  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex, __pyx_t_float_complex);
2318  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_neg_float(__pyx_t_float_complex);
2319  static CYTHON_INLINE int __Pyx_c_is_zero_float(__pyx_t_float_complex);
2320  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conj_float(__pyx_t_float_complex);
2321  #if 1
2322  static CYTHON_INLINE float __Pyx_c_abs_float(__pyx_t_float_complex);
2323  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_pow_float(__pyx_t_float_complex, __pyx_t_float_complex);
2324  #endif
2325 #endif
2326 
2327 /* Arithmetic.proto */
2328 #if CYTHON_CCOMPLEX
2329  #define __Pyx_c_eq_double(a, b) ((a)==(b))
2330  #define __Pyx_c_sum_double(a, b) ((a)+(b))
2331  #define __Pyx_c_diff_double(a, b) ((a)-(b))
2332  #define __Pyx_c_prod_double(a, b) ((a)*(b))
2333  #define __Pyx_c_quot_double(a, b) ((a)/(b))
2334  #define __Pyx_c_neg_double(a) (-(a))
2335  #ifdef __cplusplus
2336  #define __Pyx_c_is_zero_double(z) ((z)==(double)0)
2337  #define __Pyx_c_conj_double(z) (::std::conj(z))
2338  #if 1
2339  #define __Pyx_c_abs_double(z) (::std::abs(z))
2340  #define __Pyx_c_pow_double(a, b) (::std::pow(a, b))
2341  #endif
2342  #else
2343  #define __Pyx_c_is_zero_double(z) ((z)==0)
2344  #define __Pyx_c_conj_double(z) (conj(z))
2345  #if 1
2346  #define __Pyx_c_abs_double(z) (cabs(z))
2347  #define __Pyx_c_pow_double(a, b) (cpow(a, b))
2348  #endif
2349  #endif
2350 #else
2351  static CYTHON_INLINE int __Pyx_c_eq_double(__pyx_t_double_complex, __pyx_t_double_complex);
2352  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum_double(__pyx_t_double_complex, __pyx_t_double_complex);
2353  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff_double(__pyx_t_double_complex, __pyx_t_double_complex);
2354  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod_double(__pyx_t_double_complex, __pyx_t_double_complex);
2355  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex, __pyx_t_double_complex);
2356  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg_double(__pyx_t_double_complex);
2357  static CYTHON_INLINE int __Pyx_c_is_zero_double(__pyx_t_double_complex);
2358  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj_double(__pyx_t_double_complex);
2359  #if 1
2360  static CYTHON_INLINE double __Pyx_c_abs_double(__pyx_t_double_complex);
2361  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow_double(__pyx_t_double_complex, __pyx_t_double_complex);
2362  #endif
2363 #endif
2364 
2365 /* CIntToPy.proto */
2366 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum__NPY_TYPES(enum NPY_TYPES value);
2367 
2368 #if PY_MAJOR_VERSION < 3
2369  static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view, int flags);
2370  static void __Pyx_ReleaseBuffer(Py_buffer *view);
2371 #else
2372  #define __Pyx_GetBuffer PyObject_GetBuffer
2373  #define __Pyx_ReleaseBuffer PyBuffer_Release
2374 #endif
2375 
2376 
2377 /* BufferStructDeclare.proto */
2378 typedef struct {
2379  Py_ssize_t shape, strides, suboffsets;
2380 } __Pyx_Buf_DimInfo;
2381 typedef struct {
2382  size_t refcount;
2383  Py_buffer pybuffer;
2384 } __Pyx_Buffer;
2385 typedef struct {
2386  __Pyx_Buffer *rcbuffer;
2387  char *data;
2388  __Pyx_Buf_DimInfo diminfo[8];
2389 } __Pyx_LocalBuf_ND;
2390 
2391 /* MemviewSliceIsContig.proto */
2392 static int __pyx_memviewslice_is_contig(const __Pyx_memviewslice mvs, char order, int ndim);
2393 
2394 /* OverlappingSlices.proto */
2395 static int __pyx_slices_overlap(__Pyx_memviewslice *slice1,
2396  __Pyx_memviewslice *slice2,
2397  int ndim, size_t itemsize);
2398 
2399 /* Capsule.proto */
2400 static CYTHON_INLINE PyObject *__pyx_capsule_create(void *p, const char *sig);
2401 
2402 /* CIntFromPy.proto */
2403 static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *);
2404 
2405 /* TypeInfoToFormat.proto */
2406 struct __pyx_typeinfo_string {
2407  char string[3];
2408 };
2409 static struct __pyx_typeinfo_string __Pyx_TypeInfoToFormat(__Pyx_TypeInfo *type);
2410 
2411 /* MemviewSliceCopyTemplate.proto */
2412 static __Pyx_memviewslice
2413 __pyx_memoryview_copy_new_contig(const __Pyx_memviewslice *from_mvs,
2414  const char *mode, int ndim,
2415  size_t sizeof_dtype, int contig_flag,
2416  int dtype_is_object);
2417 
2418 /* MemviewSliceInit.proto */
2419 #define __Pyx_BUF_MAX_NDIMS %(BUF_MAX_NDIMS)d
2420 #define __Pyx_MEMVIEW_DIRECT 1
2421 #define __Pyx_MEMVIEW_PTR 2
2422 #define __Pyx_MEMVIEW_FULL 4
2423 #define __Pyx_MEMVIEW_CONTIG 8
2424 #define __Pyx_MEMVIEW_STRIDED 16
2425 #define __Pyx_MEMVIEW_FOLLOW 32
2426 #define __Pyx_IS_C_CONTIG 1
2427 #define __Pyx_IS_F_CONTIG 2
2428 static int __Pyx_init_memviewslice(
2429  struct __pyx_memoryview_obj *memview,
2430  int ndim,
2431  __Pyx_memviewslice *memviewslice,
2432  int memview_is_new_reference);
2433 static CYTHON_INLINE int __pyx_add_acquisition_count_locked(
2434  __pyx_atomic_int *acquisition_count, PyThread_type_lock lock);
2435 static CYTHON_INLINE int __pyx_sub_acquisition_count_locked(
2436  __pyx_atomic_int *acquisition_count, PyThread_type_lock lock);
2437 #define __pyx_get_slice_count_pointer(memview) (memview->acquisition_count_aligned_p)
2438 #define __pyx_get_slice_count(memview) (*__pyx_get_slice_count_pointer(memview))
2439 #define __PYX_INC_MEMVIEW(slice, have_gil) __Pyx_INC_MEMVIEW(slice, have_gil, __LINE__)
2440 #define __PYX_XDEC_MEMVIEW(slice, have_gil) __Pyx_XDEC_MEMVIEW(slice, have_gil, __LINE__)
2441 static CYTHON_INLINE void __Pyx_INC_MEMVIEW(__Pyx_memviewslice *, int, int);
2442 static CYTHON_INLINE void __Pyx_XDEC_MEMVIEW(__Pyx_memviewslice *, int, int);
2443 
2444 /* CIntFromPy.proto */
2445 static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *);
2446 
2447 /* CIntToPy.proto */
2448 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value);
2449 
2450 /* CIntFromPy.proto */
2451 static CYTHON_INLINE char __Pyx_PyInt_As_char(PyObject *);
2452 
2453 /* CheckBinaryVersion.proto */
2454 static int __Pyx_check_binary_version(void);
2455 
2456 /* InitStrings.proto */
2457 static int __Pyx_InitStrings(__Pyx_StringTabEntry *t);
2458 
2459 static PyObject *__pyx_array_get_memview(struct __pyx_array_obj *__pyx_v_self); /* proto*/
2460 static char *__pyx_memoryview_get_item_pointer(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index); /* proto*/
2461 static PyObject *__pyx_memoryview_is_slice(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj); /* proto*/
2462 static PyObject *__pyx_memoryview_setitem_slice_assignment(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_dst, PyObject *__pyx_v_src); /* proto*/
2463 static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memoryview_obj *__pyx_v_self, struct __pyx_memoryview_obj *__pyx_v_dst, PyObject *__pyx_v_value); /* proto*/
2464 static PyObject *__pyx_memoryview_setitem_indexed(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value); /* proto*/
2465 static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview_obj *__pyx_v_self, char *__pyx_v_itemp); /* proto*/
2466 static PyObject *__pyx_memoryview_assign_item_from_object(struct __pyx_memoryview_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value); /* proto*/
2467 static PyObject *__pyx_memoryviewslice_convert_item_to_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp); /* proto*/
2468 static PyObject *__pyx_memoryviewslice_assign_item_from_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value); /* proto*/
2469 
2470 /* Module declarations from 'cpython.buffer' */
2471 
2472 /* Module declarations from 'libc.string' */
2473 
2474 /* Module declarations from 'libc.stdio' */
2475 
2476 /* Module declarations from '__builtin__' */
2477 
2478 /* Module declarations from 'cpython.type' */
2479 static PyTypeObject *__pyx_ptype_7cpython_4type_type = 0;
2480 
2481 /* Module declarations from 'cpython' */
2482 
2483 /* Module declarations from 'cpython.object' */
2484 
2485 /* Module declarations from 'cpython.ref' */
2486 
2487 /* Module declarations from 'cpython.mem' */
2488 
2489 /* Module declarations from 'numpy' */
2490 
2491 /* Module declarations from 'numpy' */
2492 static PyTypeObject *__pyx_ptype_5numpy_dtype = 0;
2493 static PyTypeObject *__pyx_ptype_5numpy_flatiter = 0;
2494 static PyTypeObject *__pyx_ptype_5numpy_broadcast = 0;
2495 static PyTypeObject *__pyx_ptype_5numpy_ndarray = 0;
2496 static PyTypeObject *__pyx_ptype_5numpy_ufunc = 0;
2497 static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *, char *, char *, int *); /*proto*/
2498 
2499 /* Module declarations from 'mpi4py.libmpi' */
2500 
2501 /* Module declarations from 'mpi4py.MPI' */
2502 static PyTypeObject *__pyx_ptype_6mpi4py_3MPI_Status = 0;
2503 static PyTypeObject *__pyx_ptype_6mpi4py_3MPI_Datatype = 0;
2504 static PyTypeObject *__pyx_ptype_6mpi4py_3MPI_Request = 0;
2505 static PyTypeObject *__pyx_ptype_6mpi4py_3MPI_Prequest = 0;
2506 static PyTypeObject *__pyx_ptype_6mpi4py_3MPI_Grequest = 0;
2507 static PyTypeObject *__pyx_ptype_6mpi4py_3MPI_Message = 0;
2508 static PyTypeObject *__pyx_ptype_6mpi4py_3MPI_Op = 0;
2509 static PyTypeObject *__pyx_ptype_6mpi4py_3MPI_Group = 0;
2510 static PyTypeObject *__pyx_ptype_6mpi4py_3MPI_Info = 0;
2511 static PyTypeObject *__pyx_ptype_6mpi4py_3MPI_Errhandler = 0;
2512 static PyTypeObject *__pyx_ptype_6mpi4py_3MPI_Comm = 0;
2513 static PyTypeObject *__pyx_ptype_6mpi4py_3MPI_Intracomm = 0;
2514 static PyTypeObject *__pyx_ptype_6mpi4py_3MPI_Topocomm = 0;
2515 static PyTypeObject *__pyx_ptype_6mpi4py_3MPI_Cartcomm = 0;
2516 static PyTypeObject *__pyx_ptype_6mpi4py_3MPI_Graphcomm = 0;
2517 static PyTypeObject *__pyx_ptype_6mpi4py_3MPI_Distgraphcomm = 0;
2518 static PyTypeObject *__pyx_ptype_6mpi4py_3MPI_Intercomm = 0;
2519 static PyTypeObject *__pyx_ptype_6mpi4py_3MPI_Win = 0;
2520 static PyTypeObject *__pyx_ptype_6mpi4py_3MPI_File = 0;
2521 
2522 /* Module declarations from 'libcpp' */
2523 
2524 /* Module declarations from 'mesh' */
2525 
2526 /* Module declarations from 'proteus' */
2527 
2528 /* Module declarations from 'proteus.mesh' */
2529 
2530 /* Module declarations from 'proteus.cmeshTools' */
2531 static PyTypeObject *__pyx_ptype_7proteus_10cmeshTools_CMesh = 0;
2532 
2533 /* Module declarations from 'proteus.partitioning' */
2534 
2535 /* Module declarations from 'cpartitioning' */
2536 static PyTypeObject *__pyx_array_type = 0;
2537 static PyTypeObject *__pyx_MemviewEnum_type = 0;
2538 static PyTypeObject *__pyx_memoryview_type = 0;
2539 static PyTypeObject *__pyx_memoryviewslice_type = 0;
2540 static PyObject *generic = 0;
2541 static PyObject *strided = 0;
2542 static PyObject *indirect = 0;
2543 static PyObject *contiguous = 0;
2544 static PyObject *indirect_contiguous = 0;
2545 static int __pyx_memoryview_thread_locks_used;
2546 static PyThread_type_lock __pyx_memoryview_thread_locks[8];
2547 static struct __pyx_array_obj *__pyx_array_new(PyObject *, Py_ssize_t, char *, char *, char *); /*proto*/
2548 static void *__pyx_align_pointer(void *, size_t); /*proto*/
2549 static PyObject *__pyx_memoryview_new(PyObject *, int, int, __Pyx_TypeInfo *); /*proto*/
2550 static CYTHON_INLINE int __pyx_memoryview_check(PyObject *); /*proto*/
2551 static PyObject *_unellipsify(PyObject *, int); /*proto*/
2552 static PyObject *assert_direct_dimensions(Py_ssize_t *, int); /*proto*/
2553 static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_obj *, PyObject *); /*proto*/
2554 static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *, Py_ssize_t, Py_ssize_t, Py_ssize_t, int, int, int *, Py_ssize_t, Py_ssize_t, Py_ssize_t, int, int, int, int); /*proto*/
2555 static char *__pyx_pybuffer_index(Py_buffer *, char *, Py_ssize_t, Py_ssize_t); /*proto*/
2556 static int __pyx_memslice_transpose(__Pyx_memviewslice *); /*proto*/
2557 static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice, int, PyObject *(*)(char *), int (*)(char *, PyObject *), int); /*proto*/
2558 static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(struct __pyx_memoryview_obj *, __Pyx_memviewslice *); /*proto*/
2559 static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *, __Pyx_memviewslice *); /*proto*/
2560 static PyObject *__pyx_memoryview_copy_object(struct __pyx_memoryview_obj *); /*proto*/
2561 static PyObject *__pyx_memoryview_copy_object_from_slice(struct __pyx_memoryview_obj *, __Pyx_memviewslice *); /*proto*/
2562 static Py_ssize_t abs_py_ssize_t(Py_ssize_t); /*proto*/
2563 static char __pyx_get_best_slice_order(__Pyx_memviewslice *, int); /*proto*/
2564 static void _copy_strided_to_strided(char *, Py_ssize_t *, char *, Py_ssize_t *, Py_ssize_t *, Py_ssize_t *, int, size_t); /*proto*/
2565 static void copy_strided_to_strided(__Pyx_memviewslice *, __Pyx_memviewslice *, int, size_t); /*proto*/
2566 static Py_ssize_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *, int); /*proto*/
2567 static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *, Py_ssize_t *, Py_ssize_t, int, char); /*proto*/
2568 static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *, __Pyx_memviewslice *, char, int); /*proto*/
2569 static int __pyx_memoryview_err_extents(int, Py_ssize_t, Py_ssize_t); /*proto*/
2570 static int __pyx_memoryview_err_dim(PyObject *, char *, int); /*proto*/
2571 static int __pyx_memoryview_err(PyObject *, char *); /*proto*/
2572 static int __pyx_memoryview_copy_contents(__Pyx_memviewslice, __Pyx_memviewslice, int, int, int); /*proto*/
2573 static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *, int, int); /*proto*/
2574 static void __pyx_memoryview_refcount_copying(__Pyx_memviewslice *, int, int, int); /*proto*/
2575 static void __pyx_memoryview_refcount_objects_in_slice_with_gil(char *, Py_ssize_t *, Py_ssize_t *, int, int); /*proto*/
2576 static void __pyx_memoryview_refcount_objects_in_slice(char *, Py_ssize_t *, Py_ssize_t *, int, int); /*proto*/
2577 static void __pyx_memoryview_slice_assign_scalar(__Pyx_memviewslice *, int, size_t, void *, int); /*proto*/
2578 static void __pyx_memoryview__slice_assign_scalar(char *, Py_ssize_t *, Py_ssize_t *, int, size_t, void *); /*proto*/
2579 static PyObject *__pyx_unpickle_Enum__set_state(struct __pyx_MemviewEnum_obj *, PyObject *); /*proto*/
2580 static PyObject *__pyx_format_from_typeinfo(__Pyx_TypeInfo *); /*proto*/
2581 static __Pyx_TypeInfo __Pyx_TypeInfo_int = { "int", NULL, sizeof(int), { 0 }, 0, IS_UNSIGNED(int) ? 'U' : 'I', IS_UNSIGNED(int), 0 };
2582 #define __Pyx_MODULE_NAME "cpartitioning"
2583 extern int __pyx_module_is_main_cpartitioning;
2584 int __pyx_module_is_main_cpartitioning = 0;
2585 
2586 /* Implementation of 'cpartitioning' */
2587 static PyObject *__pyx_builtin_ValueError;
2588 static PyObject *__pyx_builtin_range;
2589 static PyObject *__pyx_builtin_RuntimeError;
2590 static PyObject *__pyx_builtin_ImportError;
2591 static PyObject *__pyx_builtin_MemoryError;
2592 static PyObject *__pyx_builtin_enumerate;
2593 static PyObject *__pyx_builtin_TypeError;
2594 static PyObject *__pyx_builtin_Ellipsis;
2595 static PyObject *__pyx_builtin_id;
2596 static PyObject *__pyx_builtin_IndexError;
2597 static const char __pyx_k_O[] = "O";
2598 static const char __pyx_k_T[] = "T{";
2599  static const char __pyx_k_c[] = "c";
2600  static const char __pyx_k_s[] = "(%s)";
2601  static const char __pyx_k_id[] = "id";
2602  static const char __pyx_k_np[] = "np";
2603  static const char __pyx_k__26[] = "^";
2604  static const char __pyx_k__27[] = "";
2605  static const char __pyx_k__28[] = ":";
2606 static const char __pyx_k__29[] = "}";
2607 static const char __pyx_k__30[] = ",";
2608 static const char __pyx_k_new[] = "__new__";
2609 static const char __pyx_k_obj[] = "obj";
2610 static const char __pyx_k_Comm[] = "Comm";
2611 static const char __pyx_k_base[] = "base";
2612 static const char __pyx_k_comm[] = "comm";
2613 static const char __pyx_k_dict[] = "__dict__";
2614 static const char __pyx_k_join[] = "join";
2615 static const char __pyx_k_main[] = "__main__";
2616 static const char __pyx_k_mode[] = "mode";
2617 static const char __pyx_k_name[] = "name";
2618 static const char __pyx_k_ndim[] = "ndim";
2619 static const char __pyx_k_pack[] = "pack";
2620 static const char __pyx_k_size[] = "size";
2621 static const char __pyx_k_step[] = "step";
2622 static const char __pyx_k_stop[] = "stop";
2623 static const char __pyx_k_test[] = "__test__";
2624 static const char __pyx_k_ASCII[] = "ASCII";
2625 static const char __pyx_k_class[] = "__class__";
2626 static const char __pyx_k_cmesh[] = "cmesh";
2627 static const char __pyx_k_error[] = "error";
2628 static const char __pyx_k_flags[] = "flags";
2629 static const char __pyx_k_numpy[] = "numpy";
2630 static const char __pyx_k_range[] = "range";
2631 static const char __pyx_k_shape[] = "shape";
2632 static const char __pyx_k_start[] = "start";
2633 static const char __pyx_k_encode[] = "encode";
2634 static const char __pyx_k_format[] = "format";
2635 static const char __pyx_k_import[] = "__import__";
2636 static const char __pyx_k_nSpace[] = "nSpace";
2637 static const char __pyx_k_name_2[] = "__name__";
2638 static const char __pyx_k_pickle[] = "pickle";
2639 static const char __pyx_k_reduce[] = "__reduce__";
2640 static const char __pyx_k_struct[] = "struct";
2641 static const char __pyx_k_unpack[] = "unpack";
2642 static const char __pyx_k_update[] = "update";
2643 static const char __pyx_k_asarray[] = "asarray";
2644 static const char __pyx_k_fortran[] = "fortran";
2645 static const char __pyx_k_memview[] = "memview";
2646 static const char __pyx_k_proteus[] = "proteus";
2647 static const char __pyx_k_Ellipsis[] = "Ellipsis";
2648 static const char __pyx_k_filebase[] = "filebase";
2649 static const char __pyx_k_getstate[] = "__getstate__";
2650 static const char __pyx_k_itemsize[] = "itemsize";
2651 static const char __pyx_k_pyx_type[] = "__pyx_type";
2652 static const char __pyx_k_setstate[] = "__setstate__";
2653 static const char __pyx_k_TypeError[] = "TypeError";
2654 static const char __pyx_k_enumerate[] = "enumerate";
2655 static const char __pyx_k_indexBase[] = "indexBase";
2656 static const char __pyx_k_pyx_state[] = "__pyx_state";
2657 static const char __pyx_k_reduce_ex[] = "__reduce_ex__";
2658 static const char __pyx_k_IndexError[] = "IndexError";
2659 static const char __pyx_k_ValueError[] = "ValueError";
2660 static const char __pyx_k_pyx_result[] = "__pyx_result";
2661 static const char __pyx_k_pyx_vtable[] = "__pyx_vtable__";
2662 static const char __pyx_k_ImportError[] = "ImportError";
2663 static const char __pyx_k_MemoryError[] = "MemoryError";
2664 static const char __pyx_k_PickleError[] = "PickleError";
2665 static const char __pyx_k_RuntimeError[] = "RuntimeError";
2666 static const char __pyx_k_nDOF_element[] = "nDOF_element";
2667 static const char __pyx_k_proteus_Comm[] = "proteus_Comm";
2668 static const char __pyx_k_pyx_checksum[] = "__pyx_checksum";
2669 static const char __pyx_k_stringsource[] = "stringsource";
2670 static const char __pyx_k_cpartitioning[] = "cpartitioning";
2671 static const char __pyx_k_pyx_getbuffer[] = "__pyx_getbuffer";
2672 static const char __pyx_k_reduce_cython[] = "__reduce_cython__";
2673 static const char __pyx_k_nDOF_subdomain[] = "nDOF_subdomain";
2674 static const char __pyx_k_partitionNodes[] = "partitionNodes";
2675 static const char __pyx_k_View_MemoryView[] = "View.MemoryView";
2676 static const char __pyx_k_allocate_buffer[] = "allocate_buffer";
2677 static const char __pyx_k_dtype_is_object[] = "dtype_is_object";
2678 static const char __pyx_k_pyx_PickleError[] = "__pyx_PickleError";
2679 static const char __pyx_k_setstate_cython[] = "__setstate_cython__";
2680 static const char __pyx_k_subdomain_cmesh[] = "subdomain_cmesh";
2681 static const char __pyx_k_dg_subdomain_l2g[] = "dg_subdomain_l2g";
2682 static const char __pyx_k_nLayersOfOverlap[] = "nLayersOfOverlap";
2683 static const char __pyx_k_max_dof_neighbors[] = "max_dof_neighbors";
2684 static const char __pyx_k_partitionElements[] = "partitionElements";
2685 static const char __pyx_k_pyx_unpickle_Enum[] = "__pyx_unpickle_Enum";
2686 static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback";
2687 static const char __pyx_k_nDOF_all_processes[] = "nDOF_all_processes";
2688 static const char __pyx_k_strided_and_direct[] = "<strided and direct>";
2689 static const char __pyx_k_strided_and_indirect[] = "<strided and indirect>";
2690 static const char __pyx_k_contiguous_and_direct[] = "<contiguous and direct>";
2691 static const char __pyx_k_MemoryView_of_r_object[] = "<MemoryView of %r object>";
2692 static const char __pyx_k_MemoryView_of_r_at_0x_x[] = "<MemoryView of %r at 0x%x>";
2693 static const char __pyx_k_contiguous_and_indirect[] = "<contiguous and indirect>";
2694 static const char __pyx_k_quadratic_lagrangeNodes[] = "quadratic_lagrangeNodes";
2695 static const char __pyx_k_quadratic_subdomain_l2g[] = "quadratic_subdomain_l2g";
2696 static const char __pyx_k_Cannot_index_with_type_s[] = "Cannot index with type '%s'";
2697 static const char __pyx_k_Invalid_shape_in_axis_d_d[] = "Invalid shape in axis %d: %d.";
2698 static const char __pyx_k_proteus_cpartitioning_pyx[] = "proteus/cpartitioning.pyx";
2699 static const char __pyx_k_edgeOffsets_subdomain_owned[] = "edgeOffsets_subdomain_owned";
2700 static const char __pyx_k_itemsize_0_for_cython_array[] = "itemsize <= 0 for cython.array";
2701 static const char __pyx_k_ndarray_is_not_C_contiguous[] = "ndarray is not C contiguous";
2702 static const char __pyx_k_nodeOffsets_subdomain_owned[] = "nodeOffsets_subdomain_owned";
2703 static const char __pyx_k_convertPUMIPartitionToPython[] = "convertPUMIPartitionToPython";
2704 static const char __pyx_k_dgNumbering_subdomain2global[] = "dgNumbering_subdomain2global";
2705 static const char __pyx_k_partitionNodesFromTetgenFiles[] = "partitionNodesFromTetgenFiles";
2706 static const char __pyx_k_unable_to_allocate_array_data[] = "unable to allocate array data.";
2707 static const char __pyx_k_dg_dof_offsets_subdomain_owned[] = "dg_dof_offsets_subdomain_owned";
2708 static const char __pyx_k_edgeNumbering_subdomain2global[] = "edgeNumbering_subdomain2global";
2709 static const char __pyx_k_elementOffsets_subdomain_owned[] = "elementOffsets_subdomain_owned";
2710 static const char __pyx_k_nodeNumbering_subdomain2global[] = "nodeNumbering_subdomain2global";
2711 static const char __pyx_k_strided_and_direct_or_indirect[] = "<strided and direct or indirect>";
2712 static const char __pyx_k_numpy_core_multiarray_failed_to[] = "numpy.core.multiarray failed to import";
2713 static const char __pyx_k_quadratic_dof_offsets_subdomain[] = "quadratic_dof_offsets_subdomain_owned";
2714 static const char __pyx_k_unknown_dtype_code_in_numpy_pxd[] = "unknown dtype code in numpy.pxd (%d)";
2715 static const char __pyx_k_Buffer_view_does_not_expose_stri[] = "Buffer view does not expose strides";
2716 static const char __pyx_k_Can_only_create_a_buffer_that_is[] = "Can only create a buffer that is contiguous in memory.";
2717 static const char __pyx_k_Cannot_assign_to_read_only_memor[] = "Cannot assign to read-only memoryview";
2718 static const char __pyx_k_Cannot_create_writable_memory_vi[] = "Cannot create writable memory view from read-only memoryview";
2719 static const char __pyx_k_Empty_shape_tuple_for_cython_arr[] = "Empty shape tuple for cython.array";
2720 static const char __pyx_k_Format_string_allocated_too_shor[] = "Format string allocated too short, see comment in numpy.pxd";
2721 static const char __pyx_k_Incompatible_checksums_s_vs_0xb0[] = "Incompatible checksums (%s vs 0xb068931 = (name))";
2722 static const char __pyx_k_Indirect_dimensions_not_supporte[] = "Indirect dimensions not supported";
2723 static const char __pyx_k_Invalid_mode_expected_c_or_fortr[] = "Invalid mode, expected 'c' or 'fortran', got %s";
2724 static const char __pyx_k_Non_native_byte_order_not_suppor[] = "Non-native byte order not supported";
2725 static const char __pyx_k_Out_of_bounds_on_buffer_access_a[] = "Out of bounds on buffer access (axis %d)";
2726 static const char __pyx_k_Unable_to_convert_item_to_object[] = "Unable to convert item to object";
2727 static const char __pyx_k_buildDiscontinuousGalerkinLocal2[] = "buildDiscontinuousGalerkinLocal2GlobalMappings";
2728 static const char __pyx_k_buildQuadraticCubeLocal2GlobalMa[] = "buildQuadraticCubeLocal2GlobalMappings";
2729 static const char __pyx_k_buildQuadraticCubeSubdomain2Glob[] = "buildQuadraticCubeSubdomain2GlobalMappings_1d not implemented!!";
2730 static const char __pyx_k_buildQuadraticLocal2GlobalMappin[] = "buildQuadraticLocal2GlobalMappings";
2731 static const char __pyx_k_elementBoundaryNumbering_subdoma[] = "elementBoundaryNumbering_subdomain2global";
2732 static const char __pyx_k_elementBoundaryOffsets_subdomain[] = "elementBoundaryOffsets_subdomain_owned";
2733 static const char __pyx_k_elementNumbering_subdomain2globa[] = "elementNumbering_subdomain2global";
2734 static const char __pyx_k_got_differing_extents_in_dimensi[] = "got differing extents in dimension %d (got %d and %d)";
2735 static const char __pyx_k_ndarray_is_not_Fortran_contiguou[] = "ndarray is not Fortran contiguous";
2736 static const char __pyx_k_no_default___reduce___due_to_non[] = "no default __reduce__ due to non-trivial __cinit__";
2737 static const char __pyx_k_numpy_core_umath_failed_to_impor[] = "numpy.core.umath failed to import";
2738 static const char __pyx_k_quadraticNumbering_subdomain2glo[] = "quadraticNumbering_subdomain2global";
2739 static const char __pyx_k_unable_to_allocate_shape_and_str[] = "unable to allocate shape and strides.";
2740 static const char __pyx_k_Format_string_allocated_too_shor_2[] = "Format string allocated too short.";
2741 static const char __pyx_k_buildQuadraticCubeSubdomain2Glob_2[] = "buildQuadraticCubeSubdomain2GlobalMappings_2d not implemented!!";
2742 static PyObject *__pyx_n_s_ASCII;
2743 static PyObject *__pyx_kp_s_Buffer_view_does_not_expose_stri;
2744 static PyObject *__pyx_kp_s_Can_only_create_a_buffer_that_is;
2745 static PyObject *__pyx_kp_s_Cannot_assign_to_read_only_memor;
2746 static PyObject *__pyx_kp_s_Cannot_create_writable_memory_vi;
2747 static PyObject *__pyx_kp_s_Cannot_index_with_type_s;
2748 static PyObject *__pyx_n_s_Comm;
2749 static PyObject *__pyx_n_s_Ellipsis;
2750 static PyObject *__pyx_kp_s_Empty_shape_tuple_for_cython_arr;
2751 static PyObject *__pyx_kp_u_Format_string_allocated_too_shor;
2752 static PyObject *__pyx_kp_u_Format_string_allocated_too_shor_2;
2753 static PyObject *__pyx_n_s_ImportError;
2754 static PyObject *__pyx_kp_s_Incompatible_checksums_s_vs_0xb0;
2755 static PyObject *__pyx_n_s_IndexError;
2756 static PyObject *__pyx_kp_s_Indirect_dimensions_not_supporte;
2757 static PyObject *__pyx_kp_s_Invalid_mode_expected_c_or_fortr;
2758 static PyObject *__pyx_kp_s_Invalid_shape_in_axis_d_d;
2759 static PyObject *__pyx_n_s_MemoryError;
2760 static PyObject *__pyx_kp_s_MemoryView_of_r_at_0x_x;
2761 static PyObject *__pyx_kp_s_MemoryView_of_r_object;
2762 static PyObject *__pyx_kp_u_Non_native_byte_order_not_suppor;
2763 static PyObject *__pyx_n_b_O;
2764 static PyObject *__pyx_kp_s_Out_of_bounds_on_buffer_access_a;
2765 static PyObject *__pyx_n_s_PickleError;
2766 static PyObject *__pyx_n_s_RuntimeError;
2767 static PyObject *__pyx_kp_b_T;
2768 static PyObject *__pyx_n_s_TypeError;
2769 static PyObject *__pyx_kp_s_Unable_to_convert_item_to_object;
2770 static PyObject *__pyx_n_s_ValueError;
2771 static PyObject *__pyx_n_s_View_MemoryView;
2772 static PyObject *__pyx_kp_b__26;
2773 static PyObject *__pyx_kp_b__27;
2774 static PyObject *__pyx_kp_b__28;
2775 static PyObject *__pyx_kp_b__29;
2776 static PyObject *__pyx_kp_u__30;
2777 static PyObject *__pyx_n_s_allocate_buffer;
2778 static PyObject *__pyx_n_s_asarray;
2779 static PyObject *__pyx_n_s_base;
2780 static PyObject *__pyx_n_s_buildDiscontinuousGalerkinLocal2;
2781 static PyObject *__pyx_n_s_buildQuadraticCubeLocal2GlobalMa;
2782 static PyObject *__pyx_kp_s_buildQuadraticCubeSubdomain2Glob;
2783 static PyObject *__pyx_kp_s_buildQuadraticCubeSubdomain2Glob_2;
2784 static PyObject *__pyx_n_s_buildQuadraticLocal2GlobalMappin;
2785 static PyObject *__pyx_n_s_c;
2786 static PyObject *__pyx_n_u_c;
2787 static PyObject *__pyx_n_s_class;
2788 static PyObject *__pyx_n_s_cline_in_traceback;
2789 static PyObject *__pyx_n_s_cmesh;
2790 static PyObject *__pyx_n_s_comm;
2791 static PyObject *__pyx_kp_s_contiguous_and_direct;
2792 static PyObject *__pyx_kp_s_contiguous_and_indirect;
2793 static PyObject *__pyx_n_s_convertPUMIPartitionToPython;
2794 static PyObject *__pyx_n_s_cpartitioning;
2795 static PyObject *__pyx_n_s_dgNumbering_subdomain2global;
2796 static PyObject *__pyx_n_s_dg_dof_offsets_subdomain_owned;
2797 static PyObject *__pyx_n_s_dg_subdomain_l2g;
2798 static PyObject *__pyx_n_s_dict;
2799 static PyObject *__pyx_n_s_dtype_is_object;
2800 static PyObject *__pyx_n_s_edgeNumbering_subdomain2global;
2801 static PyObject *__pyx_n_s_edgeOffsets_subdomain_owned;
2802 static PyObject *__pyx_n_s_elementBoundaryNumbering_subdoma;
2803 static PyObject *__pyx_n_s_elementBoundaryOffsets_subdomain;
2804 static PyObject *__pyx_n_s_elementNumbering_subdomain2globa;
2805 static PyObject *__pyx_n_s_elementOffsets_subdomain_owned;
2806 static PyObject *__pyx_n_s_encode;
2807 static PyObject *__pyx_n_s_enumerate;
2808 static PyObject *__pyx_n_s_error;
2809 static PyObject *__pyx_n_s_filebase;
2810 static PyObject *__pyx_n_s_flags;
2811 static PyObject *__pyx_n_s_format;
2812 static PyObject *__pyx_n_s_fortran;
2813 static PyObject *__pyx_n_u_fortran;
2814 static PyObject *__pyx_n_s_getstate;
2815 static PyObject *__pyx_kp_s_got_differing_extents_in_dimensi;
2816 static PyObject *__pyx_n_s_id;
2817 static PyObject *__pyx_n_s_import;
2818 static PyObject *__pyx_n_s_indexBase;
2819 static PyObject *__pyx_n_s_itemsize;
2820 static PyObject *__pyx_kp_s_itemsize_0_for_cython_array;
2821 static PyObject *__pyx_n_s_join;
2822 static PyObject *__pyx_n_s_main;
2823 static PyObject *__pyx_n_s_max_dof_neighbors;
2824 static PyObject *__pyx_n_s_memview;
2825 static PyObject *__pyx_n_s_mode;
2826 static PyObject *__pyx_n_s_nDOF_all_processes;
2827 static PyObject *__pyx_n_s_nDOF_element;
2828 static PyObject *__pyx_n_s_nDOF_subdomain;
2829 static PyObject *__pyx_n_s_nLayersOfOverlap;
2830 static PyObject *__pyx_n_s_nSpace;
2831 static PyObject *__pyx_n_s_name;
2832 static PyObject *__pyx_n_s_name_2;
2833 static PyObject *__pyx_kp_u_ndarray_is_not_C_contiguous;
2834 static PyObject *__pyx_kp_u_ndarray_is_not_Fortran_contiguou;
2835 static PyObject *__pyx_n_s_ndim;
2836 static PyObject *__pyx_n_s_new;
2837 static PyObject *__pyx_kp_s_no_default___reduce___due_to_non;
2838 static PyObject *__pyx_n_s_nodeNumbering_subdomain2global;
2839 static PyObject *__pyx_n_s_nodeOffsets_subdomain_owned;
2840 static PyObject *__pyx_n_s_np;
2841 static PyObject *__pyx_n_s_numpy;
2842 static PyObject *__pyx_kp_s_numpy_core_multiarray_failed_to;
2843 static PyObject *__pyx_kp_s_numpy_core_umath_failed_to_impor;
2844 static PyObject *__pyx_n_s_obj;
2845 static PyObject *__pyx_n_s_pack;
2846 static PyObject *__pyx_n_s_partitionElements;
2847 static PyObject *__pyx_n_s_partitionNodes;
2848 static PyObject *__pyx_n_s_partitionNodesFromTetgenFiles;
2849 static PyObject *__pyx_n_s_pickle;
2850 static PyObject *__pyx_n_s_proteus;
2851 static PyObject *__pyx_n_s_proteus_Comm;
2852 static PyObject *__pyx_kp_s_proteus_cpartitioning_pyx;
2853 static PyObject *__pyx_n_s_pyx_PickleError;
2854 static PyObject *__pyx_n_s_pyx_checksum;
2855 static PyObject *__pyx_n_s_pyx_getbuffer;
2856 static PyObject *__pyx_n_s_pyx_result;
2857 static PyObject *__pyx_n_s_pyx_state;
2858 static PyObject *__pyx_n_s_pyx_type;
2859 static PyObject *__pyx_n_s_pyx_unpickle_Enum;
2860 static PyObject *__pyx_n_s_pyx_vtable;
2861 static PyObject *__pyx_n_s_quadraticNumbering_subdomain2glo;
2862 static PyObject *__pyx_n_s_quadratic_dof_offsets_subdomain;
2863 static PyObject *__pyx_n_s_quadratic_lagrangeNodes;
2864 static PyObject *__pyx_n_s_quadratic_subdomain_l2g;
2865 static PyObject *__pyx_n_s_range;
2866 static PyObject *__pyx_n_s_reduce;
2867 static PyObject *__pyx_n_s_reduce_cython;
2868 static PyObject *__pyx_n_s_reduce_ex;
2869 static PyObject *__pyx_kp_u_s;
2870 static PyObject *__pyx_n_s_setstate;
2871 static PyObject *__pyx_n_s_setstate_cython;
2872 static PyObject *__pyx_n_s_shape;
2873 static PyObject *__pyx_n_s_size;
2874 static PyObject *__pyx_n_s_start;
2875 static PyObject *__pyx_n_s_step;
2876 static PyObject *__pyx_n_s_stop;
2877 static PyObject *__pyx_kp_s_strided_and_direct;
2878 static PyObject *__pyx_kp_s_strided_and_direct_or_indirect;
2879 static PyObject *__pyx_kp_s_strided_and_indirect;
2880 static PyObject *__pyx_kp_s_stringsource;
2881 static PyObject *__pyx_n_s_struct;
2882 static PyObject *__pyx_n_s_subdomain_cmesh;
2883 static PyObject *__pyx_n_s_test;
2884 static PyObject *__pyx_kp_s_unable_to_allocate_array_data;
2885 static PyObject *__pyx_kp_s_unable_to_allocate_shape_and_str;
2886 static PyObject *__pyx_kp_u_unknown_dtype_code_in_numpy_pxd;
2887 static PyObject *__pyx_n_s_unpack;
2888 static PyObject *__pyx_n_s_update;
2889 static PyObject *__pyx_pf_13cpartitioning_partitionElements(CYTHON_UNUSED PyObject *__pyx_self, struct PyMPICommObject *__pyx_v_comm, int __pyx_v_nLayersOfOverlap, struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_cmesh, struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_subdomain_cmesh); /* proto */
2890 static PyObject *__pyx_pf_13cpartitioning_2partitionNodes(CYTHON_UNUSED PyObject *__pyx_self, struct PyMPICommObject *__pyx_v_comm, int __pyx_v_nLayersOfOverlap, struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_cmesh, struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_subdomain_cmesh); /* proto */
2891 static PyObject *__pyx_pf_13cpartitioning_4convertPUMIPartitionToPython(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED struct PyMPICommObject *__pyx_v_comm, struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_cmesh, struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_subdomain_cmesh); /* proto */
2892 static PyObject *__pyx_pf_13cpartitioning_6partitionNodesFromTetgenFiles(CYTHON_UNUSED PyObject *__pyx_self, struct PyMPICommObject *__pyx_v_comm, PyObject *__pyx_v_filebase, int __pyx_v_indexBase, int __pyx_v_nLayersOfOverlap, struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_cmesh, struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_subdomain_cmesh); /* proto */
2893 static PyObject *__pyx_pf_13cpartitioning_8buildQuadraticLocal2GlobalMappings(CYTHON_UNUSED PyObject *__pyx_self, struct PyMPICommObject *__pyx_v_comm, int __pyx_v_nSpace, struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_cmesh, CYTHON_UNUSED struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_subdomain_cmesh, PyArrayObject *__pyx_v_elementOffsets_subdomain_owned, PyArrayObject *__pyx_v_nodeOffsets_subdomain_owned, PyArrayObject *__pyx_v_elementBoundaryOffsets_subdomain_owned, PyArrayObject *__pyx_v_edgeOffsets_subdomain_owned, PyArrayObject *__pyx_v_elementNumbering_subdomain2global, PyArrayObject *__pyx_v_nodeNumbering_subdomain2global, PyArrayObject *__pyx_v_elementBoundaryNumbering_subdomain2global, PyArrayObject *__pyx_v_edgeNumbering_subdomain2global, PyArrayObject *__pyx_v_quadratic_dof_offsets_subdomain_owned, PyArrayObject *__pyx_v_quadratic_subdomain_l2g, PyArrayObject *__pyx_v_quadraticNumbering_subdomain2global, PyArrayObject *__pyx_v_quadratic_lagrangeNodes); /* proto */
2894 static PyObject *__pyx_pf_13cpartitioning_10buildQuadraticCubeLocal2GlobalMappings(CYTHON_UNUSED PyObject *__pyx_self, struct PyMPICommObject *__pyx_v_comm, int __pyx_v_nSpace, struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_cmesh, CYTHON_UNUSED struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_subdomain_cmesh, CYTHON_UNUSED PyArrayObject *__pyx_v_elementOffsets_subdomain_owned, PyArrayObject *__pyx_v_nodeOffsets_subdomain_owned, CYTHON_UNUSED PyArrayObject *__pyx_v_elementBoundaryOffsets_subdomain_owned, PyArrayObject *__pyx_v_edgeOffsets_subdomain_owned, CYTHON_UNUSED PyArrayObject *__pyx_v_elementNumbering_subdomain2global, PyArrayObject *__pyx_v_nodeNumbering_subdomain2global, CYTHON_UNUSED PyArrayObject *__pyx_v_elementBoundaryNumbering_subdomain2global, PyArrayObject *__pyx_v_edgeNumbering_subdomain2global, PyArrayObject *__pyx_v_quadratic_dof_offsets_subdomain_owned, PyArrayObject *__pyx_v_quadratic_subdomain_l2g, PyArrayObject *__pyx_v_quadraticNumbering_subdomain2global, PyArrayObject *__pyx_v_quadratic_lagrangeNodes); /* proto */
2895 static PyObject *__pyx_pf_13cpartitioning_12buildDiscontinuousGalerkinLocal2GlobalMappings(CYTHON_UNUSED PyObject *__pyx_self, struct PyMPICommObject *__pyx_v_comm, int __pyx_v_nDOF_element, struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_cmesh, CYTHON_UNUSED struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_subdomain_cmesh, PyArrayObject *__pyx_v_elementOffsets_subdomain_owned, PyArrayObject *__pyx_v_elementNumbering_subdomain2global, PyArrayObject *__pyx_v_dg_dof_offsets_subdomain_owned, PyArrayObject *__pyx_v_dg_subdomain_l2g, PyArrayObject *__pyx_v_dgNumbering_subdomain2global); /* proto */
2896 static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /* proto */
2897 static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info); /* proto */
2898 static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_shape, Py_ssize_t __pyx_v_itemsize, PyObject *__pyx_v_format, PyObject *__pyx_v_mode, int __pyx_v_allocate_buffer); /* proto */
2899 static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(struct __pyx_array_obj *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /* proto */
2900 static void __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(struct __pyx_array_obj *__pyx_v_self); /* proto */
2901 static PyObject *__pyx_pf_15View_dot_MemoryView_5array_7memview___get__(struct __pyx_array_obj *__pyx_v_self); /* proto */
2902 static Py_ssize_t __pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(struct __pyx_array_obj *__pyx_v_self); /* proto */
2903 static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_attr); /* proto */
2904 static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item); /* proto */
2905 static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_12__setitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value); /* proto */
2906 static PyObject *__pyx_pf___pyx_array___reduce_cython__(CYTHON_UNUSED struct __pyx_array_obj *__pyx_v_self); /* proto */
2907 static PyObject *__pyx_pf___pyx_array_2__setstate_cython__(CYTHON_UNUSED struct __pyx_array_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
2908 static int __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v_name); /* proto */
2909 static PyObject *__pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(struct __pyx_MemviewEnum_obj *__pyx_v_self); /* proto */
2910 static PyObject *__pyx_pf___pyx_MemviewEnum___reduce_cython__(struct __pyx_MemviewEnum_obj *__pyx_v_self); /* proto */
2911 static PyObject *__pyx_pf___pyx_MemviewEnum_2__setstate_cython__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v___pyx_state); /* proto */
2912 static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj, int __pyx_v_flags, int __pyx_v_dtype_is_object); /* proto */
2913 static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2914 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4__getitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index); /* proto */
2915 static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value); /* proto */
2916 static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbuffer__(struct __pyx_memoryview_obj *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /* proto */
2917 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2918 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2919 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2920 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2921 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2922 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2923 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2924 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2925 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2926 static Py_ssize_t __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_10__len__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2927 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12__repr__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2928 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14__str__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2929 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16is_c_contig(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2930 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18is_f_contig(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2931 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20copy(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2932 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22copy_fortran(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2933 static PyObject *__pyx_pf___pyx_memoryview___reduce_cython__(CYTHON_UNUSED struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2934 static PyObject *__pyx_pf___pyx_memoryview_2__setstate_cython__(CYTHON_UNUSED struct __pyx_memoryview_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
2935 static void __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(struct __pyx_memoryviewslice_obj *__pyx_v_self); /* proto */
2936 static PyObject *__pyx_pf_15View_dot_MemoryView_16_memoryviewslice_4base___get__(struct __pyx_memoryviewslice_obj *__pyx_v_self); /* proto */
2937 static PyObject *__pyx_pf___pyx_memoryviewslice___reduce_cython__(CYTHON_UNUSED struct __pyx_memoryviewslice_obj *__pyx_v_self); /* proto */
2938 static PyObject *__pyx_pf___pyx_memoryviewslice_2__setstate_cython__(CYTHON_UNUSED struct __pyx_memoryviewslice_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
2939 static PyObject *__pyx_pf_15View_dot_MemoryView___pyx_unpickle_Enum(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state); /* proto */
2940 static PyObject *__pyx_tp_new_array(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
2941 static PyObject *__pyx_tp_new_Enum(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
2942 static PyObject *__pyx_tp_new_memoryview(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
2943 static PyObject *__pyx_tp_new__memoryviewslice(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
2944 static PyObject *__pyx_int_0;
2945 static PyObject *__pyx_int_1;
2946 static PyObject *__pyx_int_184977713;
2947 static PyObject *__pyx_int_neg_1;
2948 static PyObject *__pyx_tuple_;
2949 static PyObject *__pyx_tuple__2;
2950 static PyObject *__pyx_tuple__3;
2951 static PyObject *__pyx_tuple__4;
2952 static PyObject *__pyx_tuple__5;
2953 static PyObject *__pyx_tuple__6;
2954 static PyObject *__pyx_tuple__7;
2955 static PyObject *__pyx_tuple__8;
2956 static PyObject *__pyx_tuple__9;
2957 static PyObject *__pyx_slice__22;
2958 static PyObject *__pyx_tuple__10;
2959 static PyObject *__pyx_tuple__11;
2960 static PyObject *__pyx_tuple__12;
2961 static PyObject *__pyx_tuple__13;
2962 static PyObject *__pyx_tuple__14;
2963 static PyObject *__pyx_tuple__15;
2964 static PyObject *__pyx_tuple__16;
2965 static PyObject *__pyx_tuple__17;
2966 static PyObject *__pyx_tuple__18;
2967 static PyObject *__pyx_tuple__19;
2968 static PyObject *__pyx_tuple__20;
2969 static PyObject *__pyx_tuple__21;
2970 static PyObject *__pyx_tuple__23;
2971 static PyObject *__pyx_tuple__24;
2972 static PyObject *__pyx_tuple__25;
2973 static PyObject *__pyx_tuple__31;
2974 static PyObject *__pyx_tuple__33;
2975 static PyObject *__pyx_tuple__35;
2976 static PyObject *__pyx_tuple__37;
2977 static PyObject *__pyx_tuple__39;
2978 static PyObject *__pyx_tuple__41;
2979 static PyObject *__pyx_tuple__43;
2980 static PyObject *__pyx_tuple__45;
2981 static PyObject *__pyx_tuple__46;
2982 static PyObject *__pyx_tuple__47;
2983 static PyObject *__pyx_tuple__48;
2984 static PyObject *__pyx_tuple__49;
2985 static PyObject *__pyx_tuple__50;
2986 static PyObject *__pyx_codeobj__32;
2987 static PyObject *__pyx_codeobj__34;
2988 static PyObject *__pyx_codeobj__36;
2989 static PyObject *__pyx_codeobj__38;
2990 static PyObject *__pyx_codeobj__40;
2991 static PyObject *__pyx_codeobj__42;
2992 static PyObject *__pyx_codeobj__44;
2993 static PyObject *__pyx_codeobj__51;
2994 /* Late includes */
2995 
2996 /* "cpartitioning.pyx":19
2997  * buildDiscontinuousGalerkinSubdomain2GlobalMappings)
2998  *
2999  * def partitionElements(Comm comm, int nLayersOfOverlap, cmeshTools.CMesh cmesh, cmeshTools.CMesh subdomain_cmesh): # <<<<<<<<<<<<<<
3000  * cmesh.mesh.subdomainp = &subdomain_cmesh.mesh
3001  * c_partitionElements(comm.ob_mpi,
3002  */
3003 
3004 /* Python wrapper */
3005 static PyObject *__pyx_pw_13cpartitioning_1partitionElements(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
3006 static PyMethodDef __pyx_mdef_13cpartitioning_1partitionElements = {"partitionElements", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_13cpartitioning_1partitionElements, METH_VARARGS|METH_KEYWORDS, 0};
3007 static PyObject *__pyx_pw_13cpartitioning_1partitionElements(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
3008  struct PyMPICommObject *__pyx_v_comm = 0;
3009  int __pyx_v_nLayersOfOverlap;
3010  struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_cmesh = 0;
3011  struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_subdomain_cmesh = 0;
3012  PyObject *__pyx_r = 0;
3013  __Pyx_RefNannyDeclarations
3014  __Pyx_RefNannySetupContext("partitionElements (wrapper)", 0);
3015  {
3016  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_comm,&__pyx_n_s_nLayersOfOverlap,&__pyx_n_s_cmesh,&__pyx_n_s_subdomain_cmesh,0};
3017  PyObject* values[4] = {0,0,0,0};
3018  if (unlikely(__pyx_kwds)) {
3019  Py_ssize_t kw_args;
3020  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
3021  switch (pos_args) {
3022  case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
3023  CYTHON_FALLTHROUGH;
3024  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
3025  CYTHON_FALLTHROUGH;
3026  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3027  CYTHON_FALLTHROUGH;
3028  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3029  CYTHON_FALLTHROUGH;
3030  case 0: break;
3031  default: goto __pyx_L5_argtuple_error;
3032  }
3033  kw_args = PyDict_Size(__pyx_kwds);
3034  switch (pos_args) {
3035  case 0:
3036  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_comm)) != 0)) kw_args--;
3037  else goto __pyx_L5_argtuple_error;
3038  CYTHON_FALLTHROUGH;
3039  case 1:
3040  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nLayersOfOverlap)) != 0)) kw_args--;
3041  else {
3042  __Pyx_RaiseArgtupleInvalid("partitionElements", 1, 4, 4, 1); __PYX_ERR(0, 19, __pyx_L3_error)
3043  }
3044  CYTHON_FALLTHROUGH;
3045  case 2:
3046  if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_cmesh)) != 0)) kw_args--;
3047  else {
3048  __Pyx_RaiseArgtupleInvalid("partitionElements", 1, 4, 4, 2); __PYX_ERR(0, 19, __pyx_L3_error)
3049  }
3050  CYTHON_FALLTHROUGH;
3051  case 3:
3052  if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_subdomain_cmesh)) != 0)) kw_args--;
3053  else {
3054  __Pyx_RaiseArgtupleInvalid("partitionElements", 1, 4, 4, 3); __PYX_ERR(0, 19, __pyx_L3_error)
3055  }
3056  }
3057  if (unlikely(kw_args > 0)) {
3058  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "partitionElements") < 0)) __PYX_ERR(0, 19, __pyx_L3_error)
3059  }
3060  } else if (PyTuple_GET_SIZE(__pyx_args) != 4) {
3061  goto __pyx_L5_argtuple_error;
3062  } else {
3063  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3064  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3065  values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
3066  values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
3067  }
3068  __pyx_v_comm = ((struct PyMPICommObject *)values[0]);
3069  __pyx_v_nLayersOfOverlap = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_nLayersOfOverlap == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 19, __pyx_L3_error)
3070  __pyx_v_cmesh = ((struct __pyx_obj_7proteus_10cmeshTools_CMesh *)values[2]);
3071  __pyx_v_subdomain_cmesh = ((struct __pyx_obj_7proteus_10cmeshTools_CMesh *)values[3]);
3072  }
3073  goto __pyx_L4_argument_unpacking_done;
3074  __pyx_L5_argtuple_error:;
3075  __Pyx_RaiseArgtupleInvalid("partitionElements", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 19, __pyx_L3_error)
3076  __pyx_L3_error:;
3077  __Pyx_AddTraceback("cpartitioning.partitionElements", __pyx_clineno, __pyx_lineno, __pyx_filename);
3078  __Pyx_RefNannyFinishContext();
3079  return NULL;
3080  __pyx_L4_argument_unpacking_done:;
3081  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_comm), __pyx_ptype_6mpi4py_3MPI_Comm, 1, "comm", 0))) __PYX_ERR(0, 19, __pyx_L1_error)
3082  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_cmesh), __pyx_ptype_7proteus_10cmeshTools_CMesh, 1, "cmesh", 0))) __PYX_ERR(0, 19, __pyx_L1_error)
3083  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_subdomain_cmesh), __pyx_ptype_7proteus_10cmeshTools_CMesh, 1, "subdomain_cmesh", 0))) __PYX_ERR(0, 19, __pyx_L1_error)
3084  __pyx_r = __pyx_pf_13cpartitioning_partitionElements(__pyx_self, __pyx_v_comm, __pyx_v_nLayersOfOverlap, __pyx_v_cmesh, __pyx_v_subdomain_cmesh);
3085 
3086  /* function exit code */
3087  goto __pyx_L0;
3088  __pyx_L1_error:;
3089  __pyx_r = NULL;
3090  __pyx_L0:;
3091  __Pyx_RefNannyFinishContext();
3092  return __pyx_r;
3093 }
3094 
3095 static PyObject *__pyx_pf_13cpartitioning_partitionElements(CYTHON_UNUSED PyObject *__pyx_self, struct PyMPICommObject *__pyx_v_comm, int __pyx_v_nLayersOfOverlap, struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_cmesh, struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_subdomain_cmesh) {
3096  PyObject *__pyx_r = NULL;
3097  __Pyx_RefNannyDeclarations
3098  PyObject *__pyx_t_1 = NULL;
3099  PyObject *__pyx_t_2 = NULL;
3100  PyObject *__pyx_t_3 = NULL;
3101  int *__pyx_t_4;
3102  PyObject *__pyx_t_5 = NULL;
3103  Py_ssize_t __pyx_t_6;
3104  struct __pyx_array_obj *__pyx_t_7 = NULL;
3105  PyObject *__pyx_t_8 = NULL;
3106  PyObject *__pyx_t_9 = NULL;
3107  PyObject *__pyx_t_10 = NULL;
3108  PyObject *__pyx_t_11 = NULL;
3109  PyObject *__pyx_t_12 = NULL;
3110  PyObject *__pyx_t_13 = NULL;
3111  PyObject *__pyx_t_14 = NULL;
3112  __Pyx_RefNannySetupContext("partitionElements", 0);
3113 
3114  /* "cpartitioning.pyx":20
3115  *
3116  * def partitionElements(Comm comm, int nLayersOfOverlap, cmeshTools.CMesh cmesh, cmeshTools.CMesh subdomain_cmesh):
3117  * cmesh.mesh.subdomainp = &subdomain_cmesh.mesh # <<<<<<<<<<<<<<
3118  * c_partitionElements(comm.ob_mpi,
3119  * cmesh.mesh,
3120  */
3121  __pyx_v_cmesh->mesh.subdomainp = (&__pyx_v_subdomain_cmesh->mesh);
3122 
3123  /* "cpartitioning.pyx":21
3124  * def partitionElements(Comm comm, int nLayersOfOverlap, cmeshTools.CMesh cmesh, cmeshTools.CMesh subdomain_cmesh):
3125  * cmesh.mesh.subdomainp = &subdomain_cmesh.mesh
3126  * c_partitionElements(comm.ob_mpi, # <<<<<<<<<<<<<<
3127  * cmesh.mesh,
3128  * nLayersOfOverlap)
3129  */
3130  (void)(proteus::partitionElements(__pyx_v_comm->ob_mpi, __pyx_v_cmesh->mesh, __pyx_v_nLayersOfOverlap));
3131 
3132  /* "cpartitioning.pyx":24
3133  * cmesh.mesh,
3134  * nLayersOfOverlap)
3135  * return ( # <<<<<<<<<<<<<<
3136  * np.asarray(<int[:(comm.size+1)]> cmesh.mesh.elementOffsets_subdomain_owned),
3137  * np.asarray(<int[:cmesh.mesh.subdomainp.nElements_global]> cmesh.mesh.elementNumbering_subdomain2global),
3138  */
3139  __Pyx_XDECREF(__pyx_r);
3140 
3141  /* "cpartitioning.pyx":25
3142  * nLayersOfOverlap)
3143  * return (
3144  * np.asarray(<int[:(comm.size+1)]> cmesh.mesh.elementOffsets_subdomain_owned), # <<<<<<<<<<<<<<
3145  * np.asarray(<int[:cmesh.mesh.subdomainp.nElements_global]> cmesh.mesh.elementNumbering_subdomain2global),
3146  * np.asarray(<int[:(comm.size+1)]> cmesh.mesh.nodeOffsets_subdomain_owned),
3147  */
3148  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 25, __pyx_L1_error)
3149  __Pyx_GOTREF(__pyx_t_2);
3150  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_asarray); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 25, __pyx_L1_error)
3151  __Pyx_GOTREF(__pyx_t_3);
3152  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3153  __pyx_t_4 = __pyx_v_cmesh->mesh.elementOffsets_subdomain_owned;
3154  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_comm), __pyx_n_s_size); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 25, __pyx_L1_error)
3155  __Pyx_GOTREF(__pyx_t_2);
3156  __pyx_t_5 = __Pyx_PyInt_AddObjC(__pyx_t_2, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 25, __pyx_L1_error)
3157  __Pyx_GOTREF(__pyx_t_5);
3158  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3159  __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_t_5); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 25, __pyx_L1_error)
3160  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
3161  if (!__pyx_t_4) {
3162  PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
3163  __PYX_ERR(0, 25, __pyx_L1_error)
3164  }
3165  __pyx_t_2 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_int);
3166  __pyx_t_5 = Py_BuildValue((char*) "(" __PYX_BUILD_PY_SSIZE_T ")", ((Py_ssize_t)__pyx_t_6));
3167  if (unlikely(!__pyx_t_2 || !__pyx_t_5 || !PyBytes_AsString(__pyx_t_2))) __PYX_ERR(0, 25, __pyx_L1_error)
3168  __Pyx_GOTREF(__pyx_t_2);
3169  __Pyx_GOTREF(__pyx_t_5);
3170  __pyx_t_7 = __pyx_array_new(__pyx_t_5, sizeof(int), PyBytes_AS_STRING(__pyx_t_2), (char *) "c", (char *) __pyx_t_4);
3171  if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 25, __pyx_L1_error)
3172  __Pyx_GOTREF(__pyx_t_7);
3173  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
3174  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3175  __pyx_t_2 = NULL;
3176  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
3177  __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
3178  if (likely(__pyx_t_2)) {
3179  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
3180  __Pyx_INCREF(__pyx_t_2);
3181  __Pyx_INCREF(function);
3182  __Pyx_DECREF_SET(__pyx_t_3, function);
3183  }
3184  }
3185  __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_2, ((PyObject *)__pyx_t_7)) : __Pyx_PyObject_CallOneArg(__pyx_t_3, ((PyObject *)__pyx_t_7));
3186  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
3187  __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
3188  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 25, __pyx_L1_error)
3189  __Pyx_GOTREF(__pyx_t_1);
3190  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3191 
3192  /* "cpartitioning.pyx":26
3193  * return (
3194  * np.asarray(<int[:(comm.size+1)]> cmesh.mesh.elementOffsets_subdomain_owned),
3195  * np.asarray(<int[:cmesh.mesh.subdomainp.nElements_global]> cmesh.mesh.elementNumbering_subdomain2global), # <<<<<<<<<<<<<<
3196  * np.asarray(<int[:(comm.size+1)]> cmesh.mesh.nodeOffsets_subdomain_owned),
3197  * np.asarray(<int[:cmesh.mesh.subdomainp.nNodes_global]> cmesh.mesh.nodeNumbering_subdomain2global),
3198  */
3199  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 26, __pyx_L1_error)
3200  __Pyx_GOTREF(__pyx_t_2);
3201  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_asarray); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 26, __pyx_L1_error)
3202  __Pyx_GOTREF(__pyx_t_5);
3203  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3204  __pyx_t_4 = __pyx_v_cmesh->mesh.elementNumbering_subdomain2global;
3205  if (!__pyx_t_4) {
3206  PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
3207  __PYX_ERR(0, 26, __pyx_L1_error)
3208  }
3209  __pyx_t_8 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_int);
3210  __pyx_t_2 = Py_BuildValue((char*) "(" __PYX_BUILD_PY_SSIZE_T ")", ((Py_ssize_t)__pyx_v_cmesh->mesh.subdomainp->nElements_global));
3211  if (unlikely(!__pyx_t_8 || !__pyx_t_2 || !PyBytes_AsString(__pyx_t_8))) __PYX_ERR(0, 26, __pyx_L1_error)
3212  __Pyx_GOTREF(__pyx_t_8);
3213  __Pyx_GOTREF(__pyx_t_2);
3214  __pyx_t_7 = __pyx_array_new(__pyx_t_2, sizeof(int), PyBytes_AS_STRING(__pyx_t_8), (char *) "c", (char *) __pyx_t_4);
3215  if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 26, __pyx_L1_error)
3216  __Pyx_GOTREF(__pyx_t_7);
3217  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3218  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
3219  __pyx_t_8 = NULL;
3220  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
3221  __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_5);
3222  if (likely(__pyx_t_8)) {
3223  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
3224  __Pyx_INCREF(__pyx_t_8);
3225  __Pyx_INCREF(function);
3226  __Pyx_DECREF_SET(__pyx_t_5, function);
3227  }
3228  }
3229  __pyx_t_3 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_8, ((PyObject *)__pyx_t_7)) : __Pyx_PyObject_CallOneArg(__pyx_t_5, ((PyObject *)__pyx_t_7));
3230  __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
3231  __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
3232  if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 26, __pyx_L1_error)
3233  __Pyx_GOTREF(__pyx_t_3);
3234  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
3235 
3236  /* "cpartitioning.pyx":27
3237  * np.asarray(<int[:(comm.size+1)]> cmesh.mesh.elementOffsets_subdomain_owned),
3238  * np.asarray(<int[:cmesh.mesh.subdomainp.nElements_global]> cmesh.mesh.elementNumbering_subdomain2global),
3239  * np.asarray(<int[:(comm.size+1)]> cmesh.mesh.nodeOffsets_subdomain_owned), # <<<<<<<<<<<<<<
3240  * np.asarray(<int[:cmesh.mesh.subdomainp.nNodes_global]> cmesh.mesh.nodeNumbering_subdomain2global),
3241  * np.asarray(<int[:(comm.size+1)]> cmesh.mesh.elementBoundaryOffsets_subdomain_owned),
3242  */
3243  __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 27, __pyx_L1_error)
3244  __Pyx_GOTREF(__pyx_t_8);
3245  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_asarray); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 27, __pyx_L1_error)
3246  __Pyx_GOTREF(__pyx_t_2);
3247  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
3248  __pyx_t_4 = __pyx_v_cmesh->mesh.nodeOffsets_subdomain_owned;
3249  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_comm), __pyx_n_s_size); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 27, __pyx_L1_error)
3250  __Pyx_GOTREF(__pyx_t_8);
3251  __pyx_t_9 = __Pyx_PyInt_AddObjC(__pyx_t_8, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 27, __pyx_L1_error)
3252  __Pyx_GOTREF(__pyx_t_9);
3253  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
3254  __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 27, __pyx_L1_error)
3255  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
3256  if (!__pyx_t_4) {
3257  PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
3258  __PYX_ERR(0, 27, __pyx_L1_error)
3259  }
3260  __pyx_t_8 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_int);
3261  __pyx_t_9 = Py_BuildValue((char*) "(" __PYX_BUILD_PY_SSIZE_T ")", ((Py_ssize_t)__pyx_t_6));
3262  if (unlikely(!__pyx_t_8 || !__pyx_t_9 || !PyBytes_AsString(__pyx_t_8))) __PYX_ERR(0, 27, __pyx_L1_error)
3263  __Pyx_GOTREF(__pyx_t_8);
3264  __Pyx_GOTREF(__pyx_t_9);
3265  __pyx_t_7 = __pyx_array_new(__pyx_t_9, sizeof(int), PyBytes_AS_STRING(__pyx_t_8), (char *) "c", (char *) __pyx_t_4);
3266  if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 27, __pyx_L1_error)
3267  __Pyx_GOTREF(__pyx_t_7);
3268  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
3269  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
3270  __pyx_t_8 = NULL;
3271  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
3272  __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_2);
3273  if (likely(__pyx_t_8)) {
3274  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
3275  __Pyx_INCREF(__pyx_t_8);
3276  __Pyx_INCREF(function);
3277  __Pyx_DECREF_SET(__pyx_t_2, function);
3278  }
3279  }
3280  __pyx_t_5 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_8, ((PyObject *)__pyx_t_7)) : __Pyx_PyObject_CallOneArg(__pyx_t_2, ((PyObject *)__pyx_t_7));
3281  __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
3282  __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
3283  if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 27, __pyx_L1_error)
3284  __Pyx_GOTREF(__pyx_t_5);
3285  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3286 
3287  /* "cpartitioning.pyx":28
3288  * np.asarray(<int[:cmesh.mesh.subdomainp.nElements_global]> cmesh.mesh.elementNumbering_subdomain2global),
3289  * np.asarray(<int[:(comm.size+1)]> cmesh.mesh.nodeOffsets_subdomain_owned),
3290  * np.asarray(<int[:cmesh.mesh.subdomainp.nNodes_global]> cmesh.mesh.nodeNumbering_subdomain2global), # <<<<<<<<<<<<<<
3291  * np.asarray(<int[:(comm.size+1)]> cmesh.mesh.elementBoundaryOffsets_subdomain_owned),
3292  * np.asarray(<int[:cmesh.mesh.subdomainp.nElementBoundaries_global]> cmesh.mesh.elementBoundaryNumbering_subdomain2global),
3293  */
3294  __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 28, __pyx_L1_error)
3295  __Pyx_GOTREF(__pyx_t_8);
3296  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_asarray); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 28, __pyx_L1_error)
3297  __Pyx_GOTREF(__pyx_t_9);
3298  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
3299  __pyx_t_4 = __pyx_v_cmesh->mesh.nodeNumbering_subdomain2global;
3300  if (!__pyx_t_4) {
3301  PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
3302  __PYX_ERR(0, 28, __pyx_L1_error)
3303  }
3304  __pyx_t_10 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_int);
3305  __pyx_t_8 = Py_BuildValue((char*) "(" __PYX_BUILD_PY_SSIZE_T ")", ((Py_ssize_t)__pyx_v_cmesh->mesh.subdomainp->nNodes_global));
3306  if (unlikely(!__pyx_t_10 || !__pyx_t_8 || !PyBytes_AsString(__pyx_t_10))) __PYX_ERR(0, 28, __pyx_L1_error)
3307  __Pyx_GOTREF(__pyx_t_10);
3308  __Pyx_GOTREF(__pyx_t_8);
3309  __pyx_t_7 = __pyx_array_new(__pyx_t_8, sizeof(int), PyBytes_AS_STRING(__pyx_t_10), (char *) "c", (char *) __pyx_t_4);
3310  if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 28, __pyx_L1_error)
3311  __Pyx_GOTREF(__pyx_t_7);
3312  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
3313  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
3314  __pyx_t_10 = NULL;
3315  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_9))) {
3316  __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_9);
3317  if (likely(__pyx_t_10)) {
3318  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
3319  __Pyx_INCREF(__pyx_t_10);
3320  __Pyx_INCREF(function);
3321  __Pyx_DECREF_SET(__pyx_t_9, function);
3322  }
3323  }
3324  __pyx_t_2 = (__pyx_t_10) ? __Pyx_PyObject_Call2Args(__pyx_t_9, __pyx_t_10, ((PyObject *)__pyx_t_7)) : __Pyx_PyObject_CallOneArg(__pyx_t_9, ((PyObject *)__pyx_t_7));
3325  __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
3326  __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
3327  if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 28, __pyx_L1_error)
3328  __Pyx_GOTREF(__pyx_t_2);
3329  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
3330 
3331  /* "cpartitioning.pyx":29
3332  * np.asarray(<int[:(comm.size+1)]> cmesh.mesh.nodeOffsets_subdomain_owned),
3333  * np.asarray(<int[:cmesh.mesh.subdomainp.nNodes_global]> cmesh.mesh.nodeNumbering_subdomain2global),
3334  * np.asarray(<int[:(comm.size+1)]> cmesh.mesh.elementBoundaryOffsets_subdomain_owned), # <<<<<<<<<<<<<<
3335  * np.asarray(<int[:cmesh.mesh.subdomainp.nElementBoundaries_global]> cmesh.mesh.elementBoundaryNumbering_subdomain2global),
3336  * np.asarray(<int[:(comm.size+1)]> cmesh.mesh.edgeOffsets_subdomain_owned),
3337  */
3338  __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_n_s_np); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 29, __pyx_L1_error)
3339  __Pyx_GOTREF(__pyx_t_10);
3340  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_asarray); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 29, __pyx_L1_error)
3341  __Pyx_GOTREF(__pyx_t_8);
3342  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
3343  __pyx_t_4 = __pyx_v_cmesh->mesh.elementBoundaryOffsets_subdomain_owned;
3344  __pyx_t_10 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_comm), __pyx_n_s_size); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 29, __pyx_L1_error)
3345  __Pyx_GOTREF(__pyx_t_10);
3346  __pyx_t_11 = __Pyx_PyInt_AddObjC(__pyx_t_10, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 29, __pyx_L1_error)
3347  __Pyx_GOTREF(__pyx_t_11);
3348  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
3349  __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_t_11); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 29, __pyx_L1_error)
3350  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
3351  if (!__pyx_t_4) {
3352  PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
3353  __PYX_ERR(0, 29, __pyx_L1_error)
3354  }
3355  __pyx_t_10 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_int);
3356  __pyx_t_11 = Py_BuildValue((char*) "(" __PYX_BUILD_PY_SSIZE_T ")", ((Py_ssize_t)__pyx_t_6));
3357  if (unlikely(!__pyx_t_10 || !__pyx_t_11 || !PyBytes_AsString(__pyx_t_10))) __PYX_ERR(0, 29, __pyx_L1_error)
3358  __Pyx_GOTREF(__pyx_t_10);
3359  __Pyx_GOTREF(__pyx_t_11);
3360  __pyx_t_7 = __pyx_array_new(__pyx_t_11, sizeof(int), PyBytes_AS_STRING(__pyx_t_10), (char *) "c", (char *) __pyx_t_4);
3361  if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 29, __pyx_L1_error)
3362  __Pyx_GOTREF(__pyx_t_7);
3363  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
3364  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
3365  __pyx_t_10 = NULL;
3366  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_8))) {
3367  __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_8);
3368  if (likely(__pyx_t_10)) {
3369  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
3370  __Pyx_INCREF(__pyx_t_10);
3371  __Pyx_INCREF(function);
3372  __Pyx_DECREF_SET(__pyx_t_8, function);
3373  }
3374  }
3375  __pyx_t_9 = (__pyx_t_10) ? __Pyx_PyObject_Call2Args(__pyx_t_8, __pyx_t_10, ((PyObject *)__pyx_t_7)) : __Pyx_PyObject_CallOneArg(__pyx_t_8, ((PyObject *)__pyx_t_7));
3376  __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
3377  __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
3378  if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 29, __pyx_L1_error)
3379  __Pyx_GOTREF(__pyx_t_9);
3380  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
3381 
3382  /* "cpartitioning.pyx":30
3383  * np.asarray(<int[:cmesh.mesh.subdomainp.nNodes_global]> cmesh.mesh.nodeNumbering_subdomain2global),
3384  * np.asarray(<int[:(comm.size+1)]> cmesh.mesh.elementBoundaryOffsets_subdomain_owned),
3385  * np.asarray(<int[:cmesh.mesh.subdomainp.nElementBoundaries_global]> cmesh.mesh.elementBoundaryNumbering_subdomain2global), # <<<<<<<<<<<<<<
3386  * np.asarray(<int[:(comm.size+1)]> cmesh.mesh.edgeOffsets_subdomain_owned),
3387  * np.asarray(<int[:cmesh.mesh.subdomainp.nEdges_global]> cmesh.mesh.edgeNumbering_subdomain2global)
3388  */
3389  __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_n_s_np); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 30, __pyx_L1_error)
3390  __Pyx_GOTREF(__pyx_t_10);
3391  __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_asarray); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 30, __pyx_L1_error)
3392  __Pyx_GOTREF(__pyx_t_11);
3393  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
3394  __pyx_t_4 = __pyx_v_cmesh->mesh.elementBoundaryNumbering_subdomain2global;
3395  if (!__pyx_t_4) {
3396  PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
3397  __PYX_ERR(0, 30, __pyx_L1_error)
3398  }
3399  __pyx_t_12 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_int);
3400  __pyx_t_10 = Py_BuildValue((char*) "(" __PYX_BUILD_PY_SSIZE_T ")", ((Py_ssize_t)__pyx_v_cmesh->mesh.subdomainp->nElementBoundaries_global));
3401  if (unlikely(!__pyx_t_12 || !__pyx_t_10 || !PyBytes_AsString(__pyx_t_12))) __PYX_ERR(0, 30, __pyx_L1_error)
3402  __Pyx_GOTREF(__pyx_t_12);
3403  __Pyx_GOTREF(__pyx_t_10);
3404  __pyx_t_7 = __pyx_array_new(__pyx_t_10, sizeof(int), PyBytes_AS_STRING(__pyx_t_12), (char *) "c", (char *) __pyx_t_4);
3405  if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 30, __pyx_L1_error)
3406  __Pyx_GOTREF(__pyx_t_7);
3407  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
3408  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
3409  __pyx_t_12 = NULL;
3410  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_11))) {
3411  __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_11);
3412  if (likely(__pyx_t_12)) {
3413  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_11);
3414  __Pyx_INCREF(__pyx_t_12);
3415  __Pyx_INCREF(function);
3416  __Pyx_DECREF_SET(__pyx_t_11, function);
3417  }
3418  }
3419  __pyx_t_8 = (__pyx_t_12) ? __Pyx_PyObject_Call2Args(__pyx_t_11, __pyx_t_12, ((PyObject *)__pyx_t_7)) : __Pyx_PyObject_CallOneArg(__pyx_t_11, ((PyObject *)__pyx_t_7));
3420  __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
3421  __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
3422  if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 30, __pyx_L1_error)
3423  __Pyx_GOTREF(__pyx_t_8);
3424  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
3425 
3426  /* "cpartitioning.pyx":31
3427  * np.asarray(<int[:(comm.size+1)]> cmesh.mesh.elementBoundaryOffsets_subdomain_owned),
3428  * np.asarray(<int[:cmesh.mesh.subdomainp.nElementBoundaries_global]> cmesh.mesh.elementBoundaryNumbering_subdomain2global),
3429  * np.asarray(<int[:(comm.size+1)]> cmesh.mesh.edgeOffsets_subdomain_owned), # <<<<<<<<<<<<<<
3430  * np.asarray(<int[:cmesh.mesh.subdomainp.nEdges_global]> cmesh.mesh.edgeNumbering_subdomain2global)
3431  * )
3432  */
3433  __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_n_s_np); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 31, __pyx_L1_error)
3434  __Pyx_GOTREF(__pyx_t_12);
3435  __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_asarray); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 31, __pyx_L1_error)
3436  __Pyx_GOTREF(__pyx_t_10);
3437  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
3438  __pyx_t_4 = __pyx_v_cmesh->mesh.edgeOffsets_subdomain_owned;
3439  __pyx_t_12 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_comm), __pyx_n_s_size); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 31, __pyx_L1_error)
3440  __Pyx_GOTREF(__pyx_t_12);
3441  __pyx_t_13 = __Pyx_PyInt_AddObjC(__pyx_t_12, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 31, __pyx_L1_error)
3442  __Pyx_GOTREF(__pyx_t_13);
3443  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
3444  __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_t_13); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 31, __pyx_L1_error)
3445  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
3446  if (!__pyx_t_4) {
3447  PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
3448  __PYX_ERR(0, 31, __pyx_L1_error)
3449  }
3450  __pyx_t_12 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_int);
3451  __pyx_t_13 = Py_BuildValue((char*) "(" __PYX_BUILD_PY_SSIZE_T ")", ((Py_ssize_t)__pyx_t_6));
3452  if (unlikely(!__pyx_t_12 || !__pyx_t_13 || !PyBytes_AsString(__pyx_t_12))) __PYX_ERR(0, 31, __pyx_L1_error)
3453  __Pyx_GOTREF(__pyx_t_12);
3454  __Pyx_GOTREF(__pyx_t_13);
3455  __pyx_t_7 = __pyx_array_new(__pyx_t_13, sizeof(int), PyBytes_AS_STRING(__pyx_t_12), (char *) "c", (char *) __pyx_t_4);
3456  if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 31, __pyx_L1_error)
3457  __Pyx_GOTREF(__pyx_t_7);
3458  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
3459  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
3460  __pyx_t_12 = NULL;
3461  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_10))) {
3462  __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_10);
3463  if (likely(__pyx_t_12)) {
3464  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10);
3465  __Pyx_INCREF(__pyx_t_12);
3466  __Pyx_INCREF(function);
3467  __Pyx_DECREF_SET(__pyx_t_10, function);
3468  }
3469  }
3470  __pyx_t_11 = (__pyx_t_12) ? __Pyx_PyObject_Call2Args(__pyx_t_10, __pyx_t_12, ((PyObject *)__pyx_t_7)) : __Pyx_PyObject_CallOneArg(__pyx_t_10, ((PyObject *)__pyx_t_7));
3471  __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
3472  __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
3473  if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 31, __pyx_L1_error)
3474  __Pyx_GOTREF(__pyx_t_11);
3475  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
3476 
3477  /* "cpartitioning.pyx":32
3478  * np.asarray(<int[:cmesh.mesh.subdomainp.nElementBoundaries_global]> cmesh.mesh.elementBoundaryNumbering_subdomain2global),
3479  * np.asarray(<int[:(comm.size+1)]> cmesh.mesh.edgeOffsets_subdomain_owned),
3480  * np.asarray(<int[:cmesh.mesh.subdomainp.nEdges_global]> cmesh.mesh.edgeNumbering_subdomain2global) # <<<<<<<<<<<<<<
3481  * )
3482  *
3483  */
3484  __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_n_s_np); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 32, __pyx_L1_error)
3485  __Pyx_GOTREF(__pyx_t_12);
3486  __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_asarray); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 32, __pyx_L1_error)
3487  __Pyx_GOTREF(__pyx_t_13);
3488  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
3489  __pyx_t_4 = __pyx_v_cmesh->mesh.edgeNumbering_subdomain2global;
3490  if (!__pyx_t_4) {
3491  PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
3492  __PYX_ERR(0, 32, __pyx_L1_error)
3493  }
3494  __pyx_t_14 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_int);
3495  __pyx_t_12 = Py_BuildValue((char*) "(" __PYX_BUILD_PY_SSIZE_T ")", ((Py_ssize_t)__pyx_v_cmesh->mesh.subdomainp->nEdges_global));
3496  if (unlikely(!__pyx_t_14 || !__pyx_t_12 || !PyBytes_AsString(__pyx_t_14))) __PYX_ERR(0, 32, __pyx_L1_error)
3497  __Pyx_GOTREF(__pyx_t_14);
3498  __Pyx_GOTREF(__pyx_t_12);
3499  __pyx_t_7 = __pyx_array_new(__pyx_t_12, sizeof(int), PyBytes_AS_STRING(__pyx_t_14), (char *) "c", (char *) __pyx_t_4);
3500  if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 32, __pyx_L1_error)
3501  __Pyx_GOTREF(__pyx_t_7);
3502  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
3503  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
3504  __pyx_t_14 = NULL;
3505  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_13))) {
3506  __pyx_t_14 = PyMethod_GET_SELF(__pyx_t_13);
3507  if (likely(__pyx_t_14)) {
3508  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_13);
3509  __Pyx_INCREF(__pyx_t_14);
3510  __Pyx_INCREF(function);
3511  __Pyx_DECREF_SET(__pyx_t_13, function);
3512  }
3513  }
3514  __pyx_t_10 = (__pyx_t_14) ? __Pyx_PyObject_Call2Args(__pyx_t_13, __pyx_t_14, ((PyObject *)__pyx_t_7)) : __Pyx_PyObject_CallOneArg(__pyx_t_13, ((PyObject *)__pyx_t_7));
3515  __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
3516  __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
3517  if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 32, __pyx_L1_error)
3518  __Pyx_GOTREF(__pyx_t_10);
3519  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
3520 
3521  /* "cpartitioning.pyx":25
3522  * nLayersOfOverlap)
3523  * return (
3524  * np.asarray(<int[:(comm.size+1)]> cmesh.mesh.elementOffsets_subdomain_owned), # <<<<<<<<<<<<<<
3525  * np.asarray(<int[:cmesh.mesh.subdomainp.nElements_global]> cmesh.mesh.elementNumbering_subdomain2global),
3526  * np.asarray(<int[:(comm.size+1)]> cmesh.mesh.nodeOffsets_subdomain_owned),
3527  */
3528  __pyx_t_13 = PyTuple_New(8); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 25, __pyx_L1_error)
3529  __Pyx_GOTREF(__pyx_t_13);
3530  __Pyx_GIVEREF(__pyx_t_1);
3531  PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_1);
3532  __Pyx_GIVEREF(__pyx_t_3);
3533  PyTuple_SET_ITEM(__pyx_t_13, 1, __pyx_t_3);
3534  __Pyx_GIVEREF(__pyx_t_5);
3535  PyTuple_SET_ITEM(__pyx_t_13, 2, __pyx_t_5);
3536  __Pyx_GIVEREF(__pyx_t_2);
3537  PyTuple_SET_ITEM(__pyx_t_13, 3, __pyx_t_2);
3538  __Pyx_GIVEREF(__pyx_t_9);
3539  PyTuple_SET_ITEM(__pyx_t_13, 4, __pyx_t_9);
3540  __Pyx_GIVEREF(__pyx_t_8);
3541  PyTuple_SET_ITEM(__pyx_t_13, 5, __pyx_t_8);
3542  __Pyx_GIVEREF(__pyx_t_11);
3543  PyTuple_SET_ITEM(__pyx_t_13, 6, __pyx_t_11);
3544  __Pyx_GIVEREF(__pyx_t_10);
3545  PyTuple_SET_ITEM(__pyx_t_13, 7, __pyx_t_10);
3546  __pyx_t_1 = 0;
3547  __pyx_t_3 = 0;
3548  __pyx_t_5 = 0;
3549  __pyx_t_2 = 0;
3550  __pyx_t_9 = 0;
3551  __pyx_t_8 = 0;
3552  __pyx_t_11 = 0;
3553  __pyx_t_10 = 0;
3554  __pyx_r = __pyx_t_13;
3555  __pyx_t_13 = 0;
3556  goto __pyx_L0;
3557 
3558  /* "cpartitioning.pyx":19
3559  * buildDiscontinuousGalerkinSubdomain2GlobalMappings)
3560  *
3561  * def partitionElements(Comm comm, int nLayersOfOverlap, cmeshTools.CMesh cmesh, cmeshTools.CMesh subdomain_cmesh): # <<<<<<<<<<<<<<
3562  * cmesh.mesh.subdomainp = &subdomain_cmesh.mesh
3563  * c_partitionElements(comm.ob_mpi,
3564  */
3565 
3566  /* function exit code */
3567  __pyx_L1_error:;
3568  __Pyx_XDECREF(__pyx_t_1);
3569  __Pyx_XDECREF(__pyx_t_2);
3570  __Pyx_XDECREF(__pyx_t_3);
3571  __Pyx_XDECREF(__pyx_t_5);
3572  __Pyx_XDECREF(((PyObject *)__pyx_t_7));
3573  __Pyx_XDECREF(__pyx_t_8);
3574  __Pyx_XDECREF(__pyx_t_9);
3575  __Pyx_XDECREF(__pyx_t_10);
3576  __Pyx_XDECREF(__pyx_t_11);
3577  __Pyx_XDECREF(__pyx_t_12);
3578  __Pyx_XDECREF(__pyx_t_13);
3579  __Pyx_XDECREF(__pyx_t_14);
3580  __Pyx_AddTraceback("cpartitioning.partitionElements", __pyx_clineno, __pyx_lineno, __pyx_filename);
3581  __pyx_r = NULL;
3582  __pyx_L0:;
3583  __Pyx_XGIVEREF(__pyx_r);
3584  __Pyx_RefNannyFinishContext();
3585  return __pyx_r;
3586 }
3587 
3588 /* "cpartitioning.pyx":35
3589  * )
3590  *
3591  * def partitionNodes(Comm comm, int nLayersOfOverlap, cmeshTools.CMesh cmesh, cmeshTools.CMesh subdomain_cmesh): # <<<<<<<<<<<<<<
3592  * cmesh.mesh.subdomainp = &subdomain_cmesh.mesh
3593  * c_partitionNodes(comm.ob_mpi,
3594  */
3595 
3596 /* Python wrapper */
3597 static PyObject *__pyx_pw_13cpartitioning_3partitionNodes(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
3598 static PyMethodDef __pyx_mdef_13cpartitioning_3partitionNodes = {"partitionNodes", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_13cpartitioning_3partitionNodes, METH_VARARGS|METH_KEYWORDS, 0};
3599 static PyObject *__pyx_pw_13cpartitioning_3partitionNodes(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
3600  struct PyMPICommObject *__pyx_v_comm = 0;
3601  int __pyx_v_nLayersOfOverlap;
3602  struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_cmesh = 0;
3603  struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_subdomain_cmesh = 0;
3604  PyObject *__pyx_r = 0;
3605  __Pyx_RefNannyDeclarations
3606  __Pyx_RefNannySetupContext("partitionNodes (wrapper)", 0);
3607  {
3608  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_comm,&__pyx_n_s_nLayersOfOverlap,&__pyx_n_s_cmesh,&__pyx_n_s_subdomain_cmesh,0};
3609  PyObject* values[4] = {0,0,0,0};
3610  if (unlikely(__pyx_kwds)) {
3611  Py_ssize_t kw_args;
3612  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
3613  switch (pos_args) {
3614  case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
3615  CYTHON_FALLTHROUGH;
3616  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
3617  CYTHON_FALLTHROUGH;
3618  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3619  CYTHON_FALLTHROUGH;
3620  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3621  CYTHON_FALLTHROUGH;
3622  case 0: break;
3623  default: goto __pyx_L5_argtuple_error;
3624  }
3625  kw_args = PyDict_Size(__pyx_kwds);
3626  switch (pos_args) {
3627  case 0:
3628  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_comm)) != 0)) kw_args--;
3629  else goto __pyx_L5_argtuple_error;
3630  CYTHON_FALLTHROUGH;
3631  case 1:
3632  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nLayersOfOverlap)) != 0)) kw_args--;
3633  else {
3634  __Pyx_RaiseArgtupleInvalid("partitionNodes", 1, 4, 4, 1); __PYX_ERR(0, 35, __pyx_L3_error)
3635  }
3636  CYTHON_FALLTHROUGH;
3637  case 2:
3638  if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_cmesh)) != 0)) kw_args--;
3639  else {
3640  __Pyx_RaiseArgtupleInvalid("partitionNodes", 1, 4, 4, 2); __PYX_ERR(0, 35, __pyx_L3_error)
3641  }
3642  CYTHON_FALLTHROUGH;
3643  case 3:
3644  if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_subdomain_cmesh)) != 0)) kw_args--;
3645  else {
3646  __Pyx_RaiseArgtupleInvalid("partitionNodes", 1, 4, 4, 3); __PYX_ERR(0, 35, __pyx_L3_error)
3647  }
3648  }
3649  if (unlikely(kw_args > 0)) {
3650  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "partitionNodes") < 0)) __PYX_ERR(0, 35, __pyx_L3_error)
3651  }
3652  } else if (PyTuple_GET_SIZE(__pyx_args) != 4) {
3653  goto __pyx_L5_argtuple_error;
3654  } else {
3655  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3656  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3657  values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
3658  values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
3659  }
3660  __pyx_v_comm = ((struct PyMPICommObject *)values[0]);
3661  __pyx_v_nLayersOfOverlap = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_nLayersOfOverlap == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 35, __pyx_L3_error)
3662  __pyx_v_cmesh = ((struct __pyx_obj_7proteus_10cmeshTools_CMesh *)values[2]);
3663  __pyx_v_subdomain_cmesh = ((struct __pyx_obj_7proteus_10cmeshTools_CMesh *)values[3]);
3664  }
3665  goto __pyx_L4_argument_unpacking_done;
3666  __pyx_L5_argtuple_error:;
3667  __Pyx_RaiseArgtupleInvalid("partitionNodes", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 35, __pyx_L3_error)
3668  __pyx_L3_error:;
3669  __Pyx_AddTraceback("cpartitioning.partitionNodes", __pyx_clineno, __pyx_lineno, __pyx_filename);
3670  __Pyx_RefNannyFinishContext();
3671  return NULL;
3672  __pyx_L4_argument_unpacking_done:;
3673  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_comm), __pyx_ptype_6mpi4py_3MPI_Comm, 1, "comm", 0))) __PYX_ERR(0, 35, __pyx_L1_error)
3674  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_cmesh), __pyx_ptype_7proteus_10cmeshTools_CMesh, 1, "cmesh", 0))) __PYX_ERR(0, 35, __pyx_L1_error)
3675  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_subdomain_cmesh), __pyx_ptype_7proteus_10cmeshTools_CMesh, 1, "subdomain_cmesh", 0))) __PYX_ERR(0, 35, __pyx_L1_error)
3676  __pyx_r = __pyx_pf_13cpartitioning_2partitionNodes(__pyx_self, __pyx_v_comm, __pyx_v_nLayersOfOverlap, __pyx_v_cmesh, __pyx_v_subdomain_cmesh);
3677 
3678  /* function exit code */
3679  goto __pyx_L0;
3680  __pyx_L1_error:;
3681  __pyx_r = NULL;
3682  __pyx_L0:;
3683  __Pyx_RefNannyFinishContext();
3684  return __pyx_r;
3685 }
3686 
3687 static PyObject *__pyx_pf_13cpartitioning_2partitionNodes(CYTHON_UNUSED PyObject *__pyx_self, struct PyMPICommObject *__pyx_v_comm, int __pyx_v_nLayersOfOverlap, struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_cmesh, struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_subdomain_cmesh) {
3688  PyObject *__pyx_r = NULL;
3689  __Pyx_RefNannyDeclarations
3690  PyObject *__pyx_t_1 = NULL;
3691  PyObject *__pyx_t_2 = NULL;
3692  PyObject *__pyx_t_3 = NULL;
3693  int *__pyx_t_4;
3694  PyObject *__pyx_t_5 = NULL;
3695  Py_ssize_t __pyx_t_6;
3696  struct __pyx_array_obj *__pyx_t_7 = NULL;
3697  PyObject *__pyx_t_8 = NULL;
3698  PyObject *__pyx_t_9 = NULL;
3699  PyObject *__pyx_t_10 = NULL;
3700  PyObject *__pyx_t_11 = NULL;
3701  PyObject *__pyx_t_12 = NULL;
3702  PyObject *__pyx_t_13 = NULL;
3703  PyObject *__pyx_t_14 = NULL;
3704  __Pyx_RefNannySetupContext("partitionNodes", 0);
3705 
3706  /* "cpartitioning.pyx":36
3707  *
3708  * def partitionNodes(Comm comm, int nLayersOfOverlap, cmeshTools.CMesh cmesh, cmeshTools.CMesh subdomain_cmesh):
3709  * cmesh.mesh.subdomainp = &subdomain_cmesh.mesh # <<<<<<<<<<<<<<
3710  * c_partitionNodes(comm.ob_mpi,
3711  * cmesh.mesh,
3712  */
3713  __pyx_v_cmesh->mesh.subdomainp = (&__pyx_v_subdomain_cmesh->mesh);
3714 
3715  /* "cpartitioning.pyx":37
3716  * def partitionNodes(Comm comm, int nLayersOfOverlap, cmeshTools.CMesh cmesh, cmeshTools.CMesh subdomain_cmesh):
3717  * cmesh.mesh.subdomainp = &subdomain_cmesh.mesh
3718  * c_partitionNodes(comm.ob_mpi, # <<<<<<<<<<<<<<
3719  * cmesh.mesh,
3720  * nLayersOfOverlap)
3721  */
3722  (void)(proteus::partitionNodes(__pyx_v_comm->ob_mpi, __pyx_v_cmesh->mesh, __pyx_v_nLayersOfOverlap));
3723 
3724  /* "cpartitioning.pyx":40
3725  * cmesh.mesh,
3726  * nLayersOfOverlap)
3727  * return ( # <<<<<<<<<<<<<<
3728  * np.asarray(<int[:comm.size+1]> cmesh.mesh.elementOffsets_subdomain_owned),
3729  * np.asarray(<int[:cmesh.mesh.subdomainp.nElements_global]> cmesh.mesh.elementNumbering_subdomain2global),
3730  */
3731  __Pyx_XDECREF(__pyx_r);
3732 
3733  /* "cpartitioning.pyx":41
3734  * nLayersOfOverlap)
3735  * return (
3736  * np.asarray(<int[:comm.size+1]> cmesh.mesh.elementOffsets_subdomain_owned), # <<<<<<<<<<<<<<
3737  * np.asarray(<int[:cmesh.mesh.subdomainp.nElements_global]> cmesh.mesh.elementNumbering_subdomain2global),
3738  * np.asarray(<int[:comm.size+1]> cmesh.mesh.nodeOffsets_subdomain_owned),
3739  */
3740  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 41, __pyx_L1_error)
3741  __Pyx_GOTREF(__pyx_t_2);
3742  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_asarray); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 41, __pyx_L1_error)
3743  __Pyx_GOTREF(__pyx_t_3);
3744  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3745  __pyx_t_4 = __pyx_v_cmesh->mesh.elementOffsets_subdomain_owned;
3746  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_comm), __pyx_n_s_size); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 41, __pyx_L1_error)
3747  __Pyx_GOTREF(__pyx_t_2);
3748  __pyx_t_5 = __Pyx_PyInt_AddObjC(__pyx_t_2, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 41, __pyx_L1_error)
3749  __Pyx_GOTREF(__pyx_t_5);
3750  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3751  __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_t_5); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 41, __pyx_L1_error)
3752  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
3753  if (!__pyx_t_4) {
3754  PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
3755  __PYX_ERR(0, 41, __pyx_L1_error)
3756  }
3757  __pyx_t_2 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_int);
3758  __pyx_t_5 = Py_BuildValue((char*) "(" __PYX_BUILD_PY_SSIZE_T ")", ((Py_ssize_t)__pyx_t_6));
3759  if (unlikely(!__pyx_t_2 || !__pyx_t_5 || !PyBytes_AsString(__pyx_t_2))) __PYX_ERR(0, 41, __pyx_L1_error)
3760  __Pyx_GOTREF(__pyx_t_2);
3761  __Pyx_GOTREF(__pyx_t_5);
3762  __pyx_t_7 = __pyx_array_new(__pyx_t_5, sizeof(int), PyBytes_AS_STRING(__pyx_t_2), (char *) "c", (char *) __pyx_t_4);
3763  if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 41, __pyx_L1_error)
3764  __Pyx_GOTREF(__pyx_t_7);
3765  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
3766  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3767  __pyx_t_2 = NULL;
3768  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
3769  __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
3770  if (likely(__pyx_t_2)) {
3771  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
3772  __Pyx_INCREF(__pyx_t_2);
3773  __Pyx_INCREF(function);
3774  __Pyx_DECREF_SET(__pyx_t_3, function);
3775  }
3776  }
3777  __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_2, ((PyObject *)__pyx_t_7)) : __Pyx_PyObject_CallOneArg(__pyx_t_3, ((PyObject *)__pyx_t_7));
3778  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
3779  __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
3780  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 41, __pyx_L1_error)
3781  __Pyx_GOTREF(__pyx_t_1);
3782  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3783 
3784  /* "cpartitioning.pyx":42
3785  * return (
3786  * np.asarray(<int[:comm.size+1]> cmesh.mesh.elementOffsets_subdomain_owned),
3787  * np.asarray(<int[:cmesh.mesh.subdomainp.nElements_global]> cmesh.mesh.elementNumbering_subdomain2global), # <<<<<<<<<<<<<<
3788  * np.asarray(<int[:comm.size+1]> cmesh.mesh.nodeOffsets_subdomain_owned),
3789  * np.asarray(<int[:cmesh.mesh.subdomainp.nNodes_global]> cmesh.mesh.nodeNumbering_subdomain2global),
3790  */
3791  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 42, __pyx_L1_error)
3792  __Pyx_GOTREF(__pyx_t_2);
3793  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_asarray); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 42, __pyx_L1_error)
3794  __Pyx_GOTREF(__pyx_t_5);
3795  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3796  __pyx_t_4 = __pyx_v_cmesh->mesh.elementNumbering_subdomain2global;
3797  if (!__pyx_t_4) {
3798  PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
3799  __PYX_ERR(0, 42, __pyx_L1_error)
3800  }
3801  __pyx_t_8 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_int);
3802  __pyx_t_2 = Py_BuildValue((char*) "(" __PYX_BUILD_PY_SSIZE_T ")", ((Py_ssize_t)__pyx_v_cmesh->mesh.subdomainp->nElements_global));
3803  if (unlikely(!__pyx_t_8 || !__pyx_t_2 || !PyBytes_AsString(__pyx_t_8))) __PYX_ERR(0, 42, __pyx_L1_error)
3804  __Pyx_GOTREF(__pyx_t_8);
3805  __Pyx_GOTREF(__pyx_t_2);
3806  __pyx_t_7 = __pyx_array_new(__pyx_t_2, sizeof(int), PyBytes_AS_STRING(__pyx_t_8), (char *) "c", (char *) __pyx_t_4);
3807  if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 42, __pyx_L1_error)
3808  __Pyx_GOTREF(__pyx_t_7);
3809  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3810  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
3811  __pyx_t_8 = NULL;
3812  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
3813  __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_5);
3814  if (likely(__pyx_t_8)) {
3815  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
3816  __Pyx_INCREF(__pyx_t_8);
3817  __Pyx_INCREF(function);
3818  __Pyx_DECREF_SET(__pyx_t_5, function);
3819  }
3820  }
3821  __pyx_t_3 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_8, ((PyObject *)__pyx_t_7)) : __Pyx_PyObject_CallOneArg(__pyx_t_5, ((PyObject *)__pyx_t_7));
3822  __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
3823  __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
3824  if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 42, __pyx_L1_error)
3825  __Pyx_GOTREF(__pyx_t_3);
3826  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
3827 
3828  /* "cpartitioning.pyx":43
3829  * np.asarray(<int[:comm.size+1]> cmesh.mesh.elementOffsets_subdomain_owned),
3830  * np.asarray(<int[:cmesh.mesh.subdomainp.nElements_global]> cmesh.mesh.elementNumbering_subdomain2global),
3831  * np.asarray(<int[:comm.size+1]> cmesh.mesh.nodeOffsets_subdomain_owned), # <<<<<<<<<<<<<<
3832  * np.asarray(<int[:cmesh.mesh.subdomainp.nNodes_global]> cmesh.mesh.nodeNumbering_subdomain2global),
3833  * np.asarray(<int[:comm.size+1]> cmesh.mesh.elementBoundaryOffsets_subdomain_owned),
3834  */
3835  __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 43, __pyx_L1_error)
3836  __Pyx_GOTREF(__pyx_t_8);
3837  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_asarray); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 43, __pyx_L1_error)
3838  __Pyx_GOTREF(__pyx_t_2);
3839  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
3840  __pyx_t_4 = __pyx_v_cmesh->mesh.nodeOffsets_subdomain_owned;
3841  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_comm), __pyx_n_s_size); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 43, __pyx_L1_error)
3842  __Pyx_GOTREF(__pyx_t_8);
3843  __pyx_t_9 = __Pyx_PyInt_AddObjC(__pyx_t_8, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 43, __pyx_L1_error)
3844  __Pyx_GOTREF(__pyx_t_9);
3845  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
3846  __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 43, __pyx_L1_error)
3847  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
3848  if (!__pyx_t_4) {
3849  PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
3850  __PYX_ERR(0, 43, __pyx_L1_error)
3851  }
3852  __pyx_t_8 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_int);
3853  __pyx_t_9 = Py_BuildValue((char*) "(" __PYX_BUILD_PY_SSIZE_T ")", ((Py_ssize_t)__pyx_t_6));
3854  if (unlikely(!__pyx_t_8 || !__pyx_t_9 || !PyBytes_AsString(__pyx_t_8))) __PYX_ERR(0, 43, __pyx_L1_error)
3855  __Pyx_GOTREF(__pyx_t_8);
3856  __Pyx_GOTREF(__pyx_t_9);
3857  __pyx_t_7 = __pyx_array_new(__pyx_t_9, sizeof(int), PyBytes_AS_STRING(__pyx_t_8), (char *) "c", (char *) __pyx_t_4);
3858  if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 43, __pyx_L1_error)
3859  __Pyx_GOTREF(__pyx_t_7);
3860  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
3861  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
3862  __pyx_t_8 = NULL;
3863  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
3864  __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_2);
3865  if (likely(__pyx_t_8)) {
3866  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
3867  __Pyx_INCREF(__pyx_t_8);
3868  __Pyx_INCREF(function);
3869  __Pyx_DECREF_SET(__pyx_t_2, function);
3870  }
3871  }
3872  __pyx_t_5 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_8, ((PyObject *)__pyx_t_7)) : __Pyx_PyObject_CallOneArg(__pyx_t_2, ((PyObject *)__pyx_t_7));
3873  __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
3874  __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
3875  if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 43, __pyx_L1_error)
3876  __Pyx_GOTREF(__pyx_t_5);
3877  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3878 
3879  /* "cpartitioning.pyx":44
3880  * np.asarray(<int[:cmesh.mesh.subdomainp.nElements_global]> cmesh.mesh.elementNumbering_subdomain2global),
3881  * np.asarray(<int[:comm.size+1]> cmesh.mesh.nodeOffsets_subdomain_owned),
3882  * np.asarray(<int[:cmesh.mesh.subdomainp.nNodes_global]> cmesh.mesh.nodeNumbering_subdomain2global), # <<<<<<<<<<<<<<
3883  * np.asarray(<int[:comm.size+1]> cmesh.mesh.elementBoundaryOffsets_subdomain_owned),
3884  * np.asarray(<int[:cmesh.mesh.subdomainp.nElementBoundaries_global]> cmesh.mesh.elementBoundaryNumbering_subdomain2global),
3885  */
3886  __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 44, __pyx_L1_error)
3887  __Pyx_GOTREF(__pyx_t_8);
3888  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_asarray); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 44, __pyx_L1_error)
3889  __Pyx_GOTREF(__pyx_t_9);
3890  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
3891  __pyx_t_4 = __pyx_v_cmesh->mesh.nodeNumbering_subdomain2global;
3892  if (!__pyx_t_4) {
3893  PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
3894  __PYX_ERR(0, 44, __pyx_L1_error)
3895  }
3896  __pyx_t_10 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_int);
3897  __pyx_t_8 = Py_BuildValue((char*) "(" __PYX_BUILD_PY_SSIZE_T ")", ((Py_ssize_t)__pyx_v_cmesh->mesh.subdomainp->nNodes_global));
3898  if (unlikely(!__pyx_t_10 || !__pyx_t_8 || !PyBytes_AsString(__pyx_t_10))) __PYX_ERR(0, 44, __pyx_L1_error)
3899  __Pyx_GOTREF(__pyx_t_10);
3900  __Pyx_GOTREF(__pyx_t_8);
3901  __pyx_t_7 = __pyx_array_new(__pyx_t_8, sizeof(int), PyBytes_AS_STRING(__pyx_t_10), (char *) "c", (char *) __pyx_t_4);
3902  if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 44, __pyx_L1_error)
3903  __Pyx_GOTREF(__pyx_t_7);
3904  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
3905  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
3906  __pyx_t_10 = NULL;
3907  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_9))) {
3908  __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_9);
3909  if (likely(__pyx_t_10)) {
3910  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
3911  __Pyx_INCREF(__pyx_t_10);
3912  __Pyx_INCREF(function);
3913  __Pyx_DECREF_SET(__pyx_t_9, function);
3914  }
3915  }
3916  __pyx_t_2 = (__pyx_t_10) ? __Pyx_PyObject_Call2Args(__pyx_t_9, __pyx_t_10, ((PyObject *)__pyx_t_7)) : __Pyx_PyObject_CallOneArg(__pyx_t_9, ((PyObject *)__pyx_t_7));
3917  __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
3918  __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
3919  if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 44, __pyx_L1_error)
3920  __Pyx_GOTREF(__pyx_t_2);
3921  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
3922 
3923  /* "cpartitioning.pyx":45
3924  * np.asarray(<int[:comm.size+1]> cmesh.mesh.nodeOffsets_subdomain_owned),
3925  * np.asarray(<int[:cmesh.mesh.subdomainp.nNodes_global]> cmesh.mesh.nodeNumbering_subdomain2global),
3926  * np.asarray(<int[:comm.size+1]> cmesh.mesh.elementBoundaryOffsets_subdomain_owned), # <<<<<<<<<<<<<<
3927  * np.asarray(<int[:cmesh.mesh.subdomainp.nElementBoundaries_global]> cmesh.mesh.elementBoundaryNumbering_subdomain2global),
3928  * np.asarray(<int[:comm.size+1]> cmesh.mesh.edgeOffsets_subdomain_owned),
3929  */
3930  __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_n_s_np); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 45, __pyx_L1_error)
3931  __Pyx_GOTREF(__pyx_t_10);
3932  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_asarray); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 45, __pyx_L1_error)
3933  __Pyx_GOTREF(__pyx_t_8);
3934  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
3935  __pyx_t_4 = __pyx_v_cmesh->mesh.elementBoundaryOffsets_subdomain_owned;
3936  __pyx_t_10 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_comm), __pyx_n_s_size); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 45, __pyx_L1_error)
3937  __Pyx_GOTREF(__pyx_t_10);
3938  __pyx_t_11 = __Pyx_PyInt_AddObjC(__pyx_t_10, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 45, __pyx_L1_error)
3939  __Pyx_GOTREF(__pyx_t_11);
3940  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
3941  __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_t_11); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 45, __pyx_L1_error)
3942  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
3943  if (!__pyx_t_4) {
3944  PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
3945  __PYX_ERR(0, 45, __pyx_L1_error)
3946  }
3947  __pyx_t_10 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_int);
3948  __pyx_t_11 = Py_BuildValue((char*) "(" __PYX_BUILD_PY_SSIZE_T ")", ((Py_ssize_t)__pyx_t_6));
3949  if (unlikely(!__pyx_t_10 || !__pyx_t_11 || !PyBytes_AsString(__pyx_t_10))) __PYX_ERR(0, 45, __pyx_L1_error)
3950  __Pyx_GOTREF(__pyx_t_10);
3951  __Pyx_GOTREF(__pyx_t_11);
3952  __pyx_t_7 = __pyx_array_new(__pyx_t_11, sizeof(int), PyBytes_AS_STRING(__pyx_t_10), (char *) "c", (char *) __pyx_t_4);
3953  if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 45, __pyx_L1_error)
3954  __Pyx_GOTREF(__pyx_t_7);
3955  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
3956  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
3957  __pyx_t_10 = NULL;
3958  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_8))) {
3959  __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_8);
3960  if (likely(__pyx_t_10)) {
3961  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
3962  __Pyx_INCREF(__pyx_t_10);
3963  __Pyx_INCREF(function);
3964  __Pyx_DECREF_SET(__pyx_t_8, function);
3965  }
3966  }
3967  __pyx_t_9 = (__pyx_t_10) ? __Pyx_PyObject_Call2Args(__pyx_t_8, __pyx_t_10, ((PyObject *)__pyx_t_7)) : __Pyx_PyObject_CallOneArg(__pyx_t_8, ((PyObject *)__pyx_t_7));
3968  __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
3969  __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
3970  if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 45, __pyx_L1_error)
3971  __Pyx_GOTREF(__pyx_t_9);
3972  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
3973 
3974  /* "cpartitioning.pyx":46
3975  * np.asarray(<int[:cmesh.mesh.subdomainp.nNodes_global]> cmesh.mesh.nodeNumbering_subdomain2global),
3976  * np.asarray(<int[:comm.size+1]> cmesh.mesh.elementBoundaryOffsets_subdomain_owned),
3977  * np.asarray(<int[:cmesh.mesh.subdomainp.nElementBoundaries_global]> cmesh.mesh.elementBoundaryNumbering_subdomain2global), # <<<<<<<<<<<<<<
3978  * np.asarray(<int[:comm.size+1]> cmesh.mesh.edgeOffsets_subdomain_owned),
3979  * np.asarray(<int[:cmesh.mesh.subdomainp.nEdges_global]> cmesh.mesh.edgeNumbering_subdomain2global)
3980  */
3981  __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_n_s_np); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 46, __pyx_L1_error)
3982  __Pyx_GOTREF(__pyx_t_10);
3983  __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_asarray); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 46, __pyx_L1_error)
3984  __Pyx_GOTREF(__pyx_t_11);
3985  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
3986  __pyx_t_4 = __pyx_v_cmesh->mesh.elementBoundaryNumbering_subdomain2global;
3987  if (!__pyx_t_4) {
3988  PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
3989  __PYX_ERR(0, 46, __pyx_L1_error)
3990  }
3991  __pyx_t_12 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_int);
3992  __pyx_t_10 = Py_BuildValue((char*) "(" __PYX_BUILD_PY_SSIZE_T ")", ((Py_ssize_t)__pyx_v_cmesh->mesh.subdomainp->nElementBoundaries_global));
3993  if (unlikely(!__pyx_t_12 || !__pyx_t_10 || !PyBytes_AsString(__pyx_t_12))) __PYX_ERR(0, 46, __pyx_L1_error)
3994  __Pyx_GOTREF(__pyx_t_12);
3995  __Pyx_GOTREF(__pyx_t_10);
3996  __pyx_t_7 = __pyx_array_new(__pyx_t_10, sizeof(int), PyBytes_AS_STRING(__pyx_t_12), (char *) "c", (char *) __pyx_t_4);
3997  if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 46, __pyx_L1_error)
3998  __Pyx_GOTREF(__pyx_t_7);
3999  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
4000  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
4001  __pyx_t_12 = NULL;
4002  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_11))) {
4003  __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_11);
4004  if (likely(__pyx_t_12)) {
4005  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_11);
4006  __Pyx_INCREF(__pyx_t_12);
4007  __Pyx_INCREF(function);
4008  __Pyx_DECREF_SET(__pyx_t_11, function);
4009  }
4010  }
4011  __pyx_t_8 = (__pyx_t_12) ? __Pyx_PyObject_Call2Args(__pyx_t_11, __pyx_t_12, ((PyObject *)__pyx_t_7)) : __Pyx_PyObject_CallOneArg(__pyx_t_11, ((PyObject *)__pyx_t_7));
4012  __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
4013  __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
4014  if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 46, __pyx_L1_error)
4015  __Pyx_GOTREF(__pyx_t_8);
4016  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
4017 
4018  /* "cpartitioning.pyx":47
4019  * np.asarray(<int[:comm.size+1]> cmesh.mesh.elementBoundaryOffsets_subdomain_owned),
4020  * np.asarray(<int[:cmesh.mesh.subdomainp.nElementBoundaries_global]> cmesh.mesh.elementBoundaryNumbering_subdomain2global),
4021  * np.asarray(<int[:comm.size+1]> cmesh.mesh.edgeOffsets_subdomain_owned), # <<<<<<<<<<<<<<
4022  * np.asarray(<int[:cmesh.mesh.subdomainp.nEdges_global]> cmesh.mesh.edgeNumbering_subdomain2global)
4023  * )
4024  */
4025  __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_n_s_np); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 47, __pyx_L1_error)
4026  __Pyx_GOTREF(__pyx_t_12);
4027  __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_asarray); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 47, __pyx_L1_error)
4028  __Pyx_GOTREF(__pyx_t_10);
4029  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
4030  __pyx_t_4 = __pyx_v_cmesh->mesh.edgeOffsets_subdomain_owned;
4031  __pyx_t_12 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_comm), __pyx_n_s_size); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 47, __pyx_L1_error)
4032  __Pyx_GOTREF(__pyx_t_12);
4033  __pyx_t_13 = __Pyx_PyInt_AddObjC(__pyx_t_12, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 47, __pyx_L1_error)
4034  __Pyx_GOTREF(__pyx_t_13);
4035  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
4036  __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_t_13); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 47, __pyx_L1_error)
4037  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
4038  if (!__pyx_t_4) {
4039  PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
4040  __PYX_ERR(0, 47, __pyx_L1_error)
4041  }
4042  __pyx_t_12 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_int);
4043  __pyx_t_13 = Py_BuildValue((char*) "(" __PYX_BUILD_PY_SSIZE_T ")", ((Py_ssize_t)__pyx_t_6));
4044  if (unlikely(!__pyx_t_12 || !__pyx_t_13 || !PyBytes_AsString(__pyx_t_12))) __PYX_ERR(0, 47, __pyx_L1_error)
4045  __Pyx_GOTREF(__pyx_t_12);
4046  __Pyx_GOTREF(__pyx_t_13);
4047  __pyx_t_7 = __pyx_array_new(__pyx_t_13, sizeof(int), PyBytes_AS_STRING(__pyx_t_12), (char *) "c", (char *) __pyx_t_4);
4048  if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 47, __pyx_L1_error)
4049  __Pyx_GOTREF(__pyx_t_7);
4050  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
4051  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
4052  __pyx_t_12 = NULL;
4053  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_10))) {
4054  __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_10);
4055  if (likely(__pyx_t_12)) {
4056  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10);
4057  __Pyx_INCREF(__pyx_t_12);
4058  __Pyx_INCREF(function);
4059  __Pyx_DECREF_SET(__pyx_t_10, function);
4060  }
4061  }
4062  __pyx_t_11 = (__pyx_t_12) ? __Pyx_PyObject_Call2Args(__pyx_t_10, __pyx_t_12, ((PyObject *)__pyx_t_7)) : __Pyx_PyObject_CallOneArg(__pyx_t_10, ((PyObject *)__pyx_t_7));
4063  __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
4064  __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
4065  if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 47, __pyx_L1_error)
4066  __Pyx_GOTREF(__pyx_t_11);
4067  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
4068 
4069  /* "cpartitioning.pyx":48
4070  * np.asarray(<int[:cmesh.mesh.subdomainp.nElementBoundaries_global]> cmesh.mesh.elementBoundaryNumbering_subdomain2global),
4071  * np.asarray(<int[:comm.size+1]> cmesh.mesh.edgeOffsets_subdomain_owned),
4072  * np.asarray(<int[:cmesh.mesh.subdomainp.nEdges_global]> cmesh.mesh.edgeNumbering_subdomain2global) # <<<<<<<<<<<<<<
4073  * )
4074  *
4075  */
4076  __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_n_s_np); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 48, __pyx_L1_error)
4077  __Pyx_GOTREF(__pyx_t_12);
4078  __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_asarray); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 48, __pyx_L1_error)
4079  __Pyx_GOTREF(__pyx_t_13);
4080  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
4081  __pyx_t_4 = __pyx_v_cmesh->mesh.edgeNumbering_subdomain2global;
4082  if (!__pyx_t_4) {
4083  PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
4084  __PYX_ERR(0, 48, __pyx_L1_error)
4085  }
4086  __pyx_t_14 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_int);
4087  __pyx_t_12 = Py_BuildValue((char*) "(" __PYX_BUILD_PY_SSIZE_T ")", ((Py_ssize_t)__pyx_v_cmesh->mesh.subdomainp->nEdges_global));
4088  if (unlikely(!__pyx_t_14 || !__pyx_t_12 || !PyBytes_AsString(__pyx_t_14))) __PYX_ERR(0, 48, __pyx_L1_error)
4089  __Pyx_GOTREF(__pyx_t_14);
4090  __Pyx_GOTREF(__pyx_t_12);
4091  __pyx_t_7 = __pyx_array_new(__pyx_t_12, sizeof(int), PyBytes_AS_STRING(__pyx_t_14), (char *) "c", (char *) __pyx_t_4);
4092  if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 48, __pyx_L1_error)
4093  __Pyx_GOTREF(__pyx_t_7);
4094  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
4095  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
4096  __pyx_t_14 = NULL;
4097  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_13))) {
4098  __pyx_t_14 = PyMethod_GET_SELF(__pyx_t_13);
4099  if (likely(__pyx_t_14)) {
4100  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_13);
4101  __Pyx_INCREF(__pyx_t_14);
4102  __Pyx_INCREF(function);
4103  __Pyx_DECREF_SET(__pyx_t_13, function);
4104  }
4105  }
4106  __pyx_t_10 = (__pyx_t_14) ? __Pyx_PyObject_Call2Args(__pyx_t_13, __pyx_t_14, ((PyObject *)__pyx_t_7)) : __Pyx_PyObject_CallOneArg(__pyx_t_13, ((PyObject *)__pyx_t_7));
4107  __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
4108  __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
4109  if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 48, __pyx_L1_error)
4110  __Pyx_GOTREF(__pyx_t_10);
4111  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
4112 
4113  /* "cpartitioning.pyx":41
4114  * nLayersOfOverlap)
4115  * return (
4116  * np.asarray(<int[:comm.size+1]> cmesh.mesh.elementOffsets_subdomain_owned), # <<<<<<<<<<<<<<
4117  * np.asarray(<int[:cmesh.mesh.subdomainp.nElements_global]> cmesh.mesh.elementNumbering_subdomain2global),
4118  * np.asarray(<int[:comm.size+1]> cmesh.mesh.nodeOffsets_subdomain_owned),
4119  */
4120  __pyx_t_13 = PyTuple_New(8); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 41, __pyx_L1_error)
4121  __Pyx_GOTREF(__pyx_t_13);
4122  __Pyx_GIVEREF(__pyx_t_1);
4123  PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_1);
4124  __Pyx_GIVEREF(__pyx_t_3);
4125  PyTuple_SET_ITEM(__pyx_t_13, 1, __pyx_t_3);
4126  __Pyx_GIVEREF(__pyx_t_5);
4127  PyTuple_SET_ITEM(__pyx_t_13, 2, __pyx_t_5);
4128  __Pyx_GIVEREF(__pyx_t_2);
4129  PyTuple_SET_ITEM(__pyx_t_13, 3, __pyx_t_2);
4130  __Pyx_GIVEREF(__pyx_t_9);
4131  PyTuple_SET_ITEM(__pyx_t_13, 4, __pyx_t_9);
4132  __Pyx_GIVEREF(__pyx_t_8);
4133  PyTuple_SET_ITEM(__pyx_t_13, 5, __pyx_t_8);
4134  __Pyx_GIVEREF(__pyx_t_11);
4135  PyTuple_SET_ITEM(__pyx_t_13, 6, __pyx_t_11);
4136  __Pyx_GIVEREF(__pyx_t_10);
4137  PyTuple_SET_ITEM(__pyx_t_13, 7, __pyx_t_10);
4138  __pyx_t_1 = 0;
4139  __pyx_t_3 = 0;
4140  __pyx_t_5 = 0;
4141  __pyx_t_2 = 0;
4142  __pyx_t_9 = 0;
4143  __pyx_t_8 = 0;
4144  __pyx_t_11 = 0;
4145  __pyx_t_10 = 0;
4146  __pyx_r = __pyx_t_13;
4147  __pyx_t_13 = 0;
4148  goto __pyx_L0;
4149 
4150  /* "cpartitioning.pyx":35
4151  * )
4152  *
4153  * def partitionNodes(Comm comm, int nLayersOfOverlap, cmeshTools.CMesh cmesh, cmeshTools.CMesh subdomain_cmesh): # <<<<<<<<<<<<<<
4154  * cmesh.mesh.subdomainp = &subdomain_cmesh.mesh
4155  * c_partitionNodes(comm.ob_mpi,
4156  */
4157 
4158  /* function exit code */
4159  __pyx_L1_error:;
4160  __Pyx_XDECREF(__pyx_t_1);
4161  __Pyx_XDECREF(__pyx_t_2);
4162  __Pyx_XDECREF(__pyx_t_3);
4163  __Pyx_XDECREF(__pyx_t_5);
4164  __Pyx_XDECREF(((PyObject *)__pyx_t_7));
4165  __Pyx_XDECREF(__pyx_t_8);
4166  __Pyx_XDECREF(__pyx_t_9);
4167  __Pyx_XDECREF(__pyx_t_10);
4168  __Pyx_XDECREF(__pyx_t_11);
4169  __Pyx_XDECREF(__pyx_t_12);
4170  __Pyx_XDECREF(__pyx_t_13);
4171  __Pyx_XDECREF(__pyx_t_14);
4172  __Pyx_AddTraceback("cpartitioning.partitionNodes", __pyx_clineno, __pyx_lineno, __pyx_filename);
4173  __pyx_r = NULL;
4174  __pyx_L0:;
4175  __Pyx_XGIVEREF(__pyx_r);
4176  __Pyx_RefNannyFinishContext();
4177  return __pyx_r;
4178 }
4179 
4180 /* "cpartitioning.pyx":51
4181  * )
4182  *
4183  * def convertPUMIPartitionToPython(Comm comm, cmeshTools.CMesh cmesh, cmeshTools.CMesh subdomain_cmesh): # <<<<<<<<<<<<<<
4184  * #need to have Python handles for the cmesh arrays created from apf/PUMI mesh
4185  * cmesh.mesh.subdomainp = &subdomain_cmesh.mesh
4186  */
4187 
4188 /* Python wrapper */
4189 static PyObject *__pyx_pw_13cpartitioning_5convertPUMIPartitionToPython(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
4190 static PyMethodDef __pyx_mdef_13cpartitioning_5convertPUMIPartitionToPython = {"convertPUMIPartitionToPython", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_13cpartitioning_5convertPUMIPartitionToPython, METH_VARARGS|METH_KEYWORDS, 0};
4191 static PyObject *__pyx_pw_13cpartitioning_5convertPUMIPartitionToPython(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
4192  CYTHON_UNUSED struct PyMPICommObject *__pyx_v_comm = 0;
4193  struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_cmesh = 0;
4194  struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_subdomain_cmesh = 0;
4195  PyObject *__pyx_r = 0;
4196  __Pyx_RefNannyDeclarations
4197  __Pyx_RefNannySetupContext("convertPUMIPartitionToPython (wrapper)", 0);
4198  {
4199  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_comm,&__pyx_n_s_cmesh,&__pyx_n_s_subdomain_cmesh,0};
4200  PyObject* values[3] = {0,0,0};
4201  if (unlikely(__pyx_kwds)) {
4202  Py_ssize_t kw_args;
4203  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
4204  switch (pos_args) {
4205  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
4206  CYTHON_FALLTHROUGH;
4207  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4208  CYTHON_FALLTHROUGH;
4209  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4210  CYTHON_FALLTHROUGH;
4211  case 0: break;
4212  default: goto __pyx_L5_argtuple_error;
4213  }
4214  kw_args = PyDict_Size(__pyx_kwds);
4215  switch (pos_args) {
4216  case 0:
4217  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_comm)) != 0)) kw_args--;
4218  else goto __pyx_L5_argtuple_error;
4219  CYTHON_FALLTHROUGH;
4220  case 1:
4221  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_cmesh)) != 0)) kw_args--;
4222  else {
4223  __Pyx_RaiseArgtupleInvalid("convertPUMIPartitionToPython", 1, 3, 3, 1); __PYX_ERR(0, 51, __pyx_L3_error)
4224  }
4225  CYTHON_FALLTHROUGH;
4226  case 2:
4227  if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_subdomain_cmesh)) != 0)) kw_args--;
4228  else {
4229  __Pyx_RaiseArgtupleInvalid("convertPUMIPartitionToPython", 1, 3, 3, 2); __PYX_ERR(0, 51, __pyx_L3_error)
4230  }
4231  }
4232  if (unlikely(kw_args > 0)) {
4233  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "convertPUMIPartitionToPython") < 0)) __PYX_ERR(0, 51, __pyx_L3_error)
4234  }
4235  } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
4236  goto __pyx_L5_argtuple_error;
4237  } else {
4238  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4239  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4240  values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
4241  }
4242  __pyx_v_comm = ((struct PyMPICommObject *)values[0]);
4243  __pyx_v_cmesh = ((struct __pyx_obj_7proteus_10cmeshTools_CMesh *)values[1]);
4244  __pyx_v_subdomain_cmesh = ((struct __pyx_obj_7proteus_10cmeshTools_CMesh *)values[2]);
4245  }
4246  goto __pyx_L4_argument_unpacking_done;
4247  __pyx_L5_argtuple_error:;
4248  __Pyx_RaiseArgtupleInvalid("convertPUMIPartitionToPython", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 51, __pyx_L3_error)
4249  __pyx_L3_error:;
4250  __Pyx_AddTraceback("cpartitioning.convertPUMIPartitionToPython", __pyx_clineno, __pyx_lineno, __pyx_filename);
4251  __Pyx_RefNannyFinishContext();
4252  return NULL;
4253  __pyx_L4_argument_unpacking_done:;
4254  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_comm), __pyx_ptype_6mpi4py_3MPI_Comm, 1, "comm", 0))) __PYX_ERR(0, 51, __pyx_L1_error)
4255  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_cmesh), __pyx_ptype_7proteus_10cmeshTools_CMesh, 1, "cmesh", 0))) __PYX_ERR(0, 51, __pyx_L1_error)
4256  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_subdomain_cmesh), __pyx_ptype_7proteus_10cmeshTools_CMesh, 1, "subdomain_cmesh", 0))) __PYX_ERR(0, 51, __pyx_L1_error)
4257  __pyx_r = __pyx_pf_13cpartitioning_4convertPUMIPartitionToPython(__pyx_self, __pyx_v_comm, __pyx_v_cmesh, __pyx_v_subdomain_cmesh);
4258 
4259  /* function exit code */
4260  goto __pyx_L0;
4261  __pyx_L1_error:;
4262  __pyx_r = NULL;
4263  __pyx_L0:;
4264  __Pyx_RefNannyFinishContext();
4265  return __pyx_r;
4266 }
4267 
4268 static PyObject *__pyx_pf_13cpartitioning_4convertPUMIPartitionToPython(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED struct PyMPICommObject *__pyx_v_comm, struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_cmesh, struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_subdomain_cmesh) {
4269  PyObject *__pyx_r = NULL;
4270  __Pyx_RefNannyDeclarations
4271  PyObject *__pyx_t_1 = NULL;
4272  PyObject *__pyx_t_2 = NULL;
4273  PyObject *__pyx_t_3 = NULL;
4274  int *__pyx_t_4;
4275  PyObject *__pyx_t_5 = NULL;
4276  Py_ssize_t __pyx_t_6;
4277  struct __pyx_array_obj *__pyx_t_7 = NULL;
4278  PyObject *__pyx_t_8 = NULL;
4279  PyObject *__pyx_t_9 = NULL;
4280  PyObject *__pyx_t_10 = NULL;
4281  PyObject *__pyx_t_11 = NULL;
4282  PyObject *__pyx_t_12 = NULL;
4283  PyObject *__pyx_t_13 = NULL;
4284  PyObject *__pyx_t_14 = NULL;
4285  __Pyx_RefNannySetupContext("convertPUMIPartitionToPython", 0);
4286 
4287  /* "cpartitioning.pyx":53
4288  * def convertPUMIPartitionToPython(Comm comm, cmeshTools.CMesh cmesh, cmeshTools.CMesh subdomain_cmesh):
4289  * #need to have Python handles for the cmesh arrays created from apf/PUMI mesh
4290  * cmesh.mesh.subdomainp = &subdomain_cmesh.mesh # <<<<<<<<<<<<<<
4291  * return (
4292  * np.asarray(<int[:comm.size+1]> cmesh.mesh.elementOffsets_subdomain_owned),
4293  */
4294  __pyx_v_cmesh->mesh.subdomainp = (&__pyx_v_subdomain_cmesh->mesh);
4295 
4296  /* "cpartitioning.pyx":54
4297  * #need to have Python handles for the cmesh arrays created from apf/PUMI mesh
4298  * cmesh.mesh.subdomainp = &subdomain_cmesh.mesh
4299  * return ( # <<<<<<<<<<<<<<
4300  * np.asarray(<int[:comm.size+1]> cmesh.mesh.elementOffsets_subdomain_owned),
4301  * np.asarray(<int[:cmesh.mesh.subdomainp.nElements_global]> cmesh.mesh.elementNumbering_subdomain2global),
4302  */
4303  __Pyx_XDECREF(__pyx_r);
4304 
4305  /* "cpartitioning.pyx":55
4306  * cmesh.mesh.subdomainp = &subdomain_cmesh.mesh
4307  * return (
4308  * np.asarray(<int[:comm.size+1]> cmesh.mesh.elementOffsets_subdomain_owned), # <<<<<<<<<<<<<<
4309  * np.asarray(<int[:cmesh.mesh.subdomainp.nElements_global]> cmesh.mesh.elementNumbering_subdomain2global),
4310  * np.asarray(<int[:comm.size+1]> cmesh.mesh.nodeOffsets_subdomain_owned),
4311  */
4312  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 55, __pyx_L1_error)
4313  __Pyx_GOTREF(__pyx_t_2);
4314  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_asarray); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 55, __pyx_L1_error)
4315  __Pyx_GOTREF(__pyx_t_3);
4316  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4317  __pyx_t_4 = __pyx_v_cmesh->mesh.elementOffsets_subdomain_owned;
4318  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_comm), __pyx_n_s_size); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 55, __pyx_L1_error)
4319  __Pyx_GOTREF(__pyx_t_2);
4320  __pyx_t_5 = __Pyx_PyInt_AddObjC(__pyx_t_2, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 55, __pyx_L1_error)
4321  __Pyx_GOTREF(__pyx_t_5);
4322  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4323  __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_t_5); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 55, __pyx_L1_error)
4324  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
4325  if (!__pyx_t_4) {
4326  PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
4327  __PYX_ERR(0, 55, __pyx_L1_error)
4328  }
4329  __pyx_t_2 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_int);
4330  __pyx_t_5 = Py_BuildValue((char*) "(" __PYX_BUILD_PY_SSIZE_T ")", ((Py_ssize_t)__pyx_t_6));
4331  if (unlikely(!__pyx_t_2 || !__pyx_t_5 || !PyBytes_AsString(__pyx_t_2))) __PYX_ERR(0, 55, __pyx_L1_error)
4332  __Pyx_GOTREF(__pyx_t_2);
4333  __Pyx_GOTREF(__pyx_t_5);
4334  __pyx_t_7 = __pyx_array_new(__pyx_t_5, sizeof(int), PyBytes_AS_STRING(__pyx_t_2), (char *) "c", (char *) __pyx_t_4);
4335  if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 55, __pyx_L1_error)
4336  __Pyx_GOTREF(__pyx_t_7);
4337  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
4338  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4339  __pyx_t_2 = NULL;
4340  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
4341  __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
4342  if (likely(__pyx_t_2)) {
4343  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
4344  __Pyx_INCREF(__pyx_t_2);
4345  __Pyx_INCREF(function);
4346  __Pyx_DECREF_SET(__pyx_t_3, function);
4347  }
4348  }
4349  __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_2, ((PyObject *)__pyx_t_7)) : __Pyx_PyObject_CallOneArg(__pyx_t_3, ((PyObject *)__pyx_t_7));
4350  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
4351  __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
4352  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 55, __pyx_L1_error)
4353  __Pyx_GOTREF(__pyx_t_1);
4354  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4355 
4356  /* "cpartitioning.pyx":56
4357  * return (
4358  * np.asarray(<int[:comm.size+1]> cmesh.mesh.elementOffsets_subdomain_owned),
4359  * np.asarray(<int[:cmesh.mesh.subdomainp.nElements_global]> cmesh.mesh.elementNumbering_subdomain2global), # <<<<<<<<<<<<<<
4360  * np.asarray(<int[:comm.size+1]> cmesh.mesh.nodeOffsets_subdomain_owned),
4361  * np.asarray(<int[:cmesh.mesh.subdomainp.nNodes_global]> cmesh.mesh.nodeNumbering_subdomain2global),
4362  */
4363  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 56, __pyx_L1_error)
4364  __Pyx_GOTREF(__pyx_t_2);
4365  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_asarray); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 56, __pyx_L1_error)
4366  __Pyx_GOTREF(__pyx_t_5);
4367  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4368  __pyx_t_4 = __pyx_v_cmesh->mesh.elementNumbering_subdomain2global;
4369  if (!__pyx_t_4) {
4370  PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
4371  __PYX_ERR(0, 56, __pyx_L1_error)
4372  }
4373  __pyx_t_8 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_int);
4374  __pyx_t_2 = Py_BuildValue((char*) "(" __PYX_BUILD_PY_SSIZE_T ")", ((Py_ssize_t)__pyx_v_cmesh->mesh.subdomainp->nElements_global));
4375  if (unlikely(!__pyx_t_8 || !__pyx_t_2 || !PyBytes_AsString(__pyx_t_8))) __PYX_ERR(0, 56, __pyx_L1_error)
4376  __Pyx_GOTREF(__pyx_t_8);
4377  __Pyx_GOTREF(__pyx_t_2);
4378  __pyx_t_7 = __pyx_array_new(__pyx_t_2, sizeof(int), PyBytes_AS_STRING(__pyx_t_8), (char *) "c", (char *) __pyx_t_4);
4379  if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 56, __pyx_L1_error)
4380  __Pyx_GOTREF(__pyx_t_7);
4381  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4382  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
4383  __pyx_t_8 = NULL;
4384  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
4385  __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_5);
4386  if (likely(__pyx_t_8)) {
4387  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
4388  __Pyx_INCREF(__pyx_t_8);
4389  __Pyx_INCREF(function);
4390  __Pyx_DECREF_SET(__pyx_t_5, function);
4391  }
4392  }
4393  __pyx_t_3 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_8, ((PyObject *)__pyx_t_7)) : __Pyx_PyObject_CallOneArg(__pyx_t_5, ((PyObject *)__pyx_t_7));
4394  __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
4395  __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
4396  if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 56, __pyx_L1_error)
4397  __Pyx_GOTREF(__pyx_t_3);
4398  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
4399 
4400  /* "cpartitioning.pyx":57
4401  * np.asarray(<int[:comm.size+1]> cmesh.mesh.elementOffsets_subdomain_owned),
4402  * np.asarray(<int[:cmesh.mesh.subdomainp.nElements_global]> cmesh.mesh.elementNumbering_subdomain2global),
4403  * np.asarray(<int[:comm.size+1]> cmesh.mesh.nodeOffsets_subdomain_owned), # <<<<<<<<<<<<<<
4404  * np.asarray(<int[:cmesh.mesh.subdomainp.nNodes_global]> cmesh.mesh.nodeNumbering_subdomain2global),
4405  * np.asarray(<int[:comm.size+1]> cmesh.mesh.elementBoundaryOffsets_subdomain_owned),
4406  */
4407  __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 57, __pyx_L1_error)
4408  __Pyx_GOTREF(__pyx_t_8);
4409  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_asarray); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 57, __pyx_L1_error)
4410  __Pyx_GOTREF(__pyx_t_2);
4411  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
4412  __pyx_t_4 = __pyx_v_cmesh->mesh.nodeOffsets_subdomain_owned;
4413  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_comm), __pyx_n_s_size); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 57, __pyx_L1_error)
4414  __Pyx_GOTREF(__pyx_t_8);
4415  __pyx_t_9 = __Pyx_PyInt_AddObjC(__pyx_t_8, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 57, __pyx_L1_error)
4416  __Pyx_GOTREF(__pyx_t_9);
4417  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
4418  __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 57, __pyx_L1_error)
4419  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
4420  if (!__pyx_t_4) {
4421  PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
4422  __PYX_ERR(0, 57, __pyx_L1_error)
4423  }
4424  __pyx_t_8 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_int);
4425  __pyx_t_9 = Py_BuildValue((char*) "(" __PYX_BUILD_PY_SSIZE_T ")", ((Py_ssize_t)__pyx_t_6));
4426  if (unlikely(!__pyx_t_8 || !__pyx_t_9 || !PyBytes_AsString(__pyx_t_8))) __PYX_ERR(0, 57, __pyx_L1_error)
4427  __Pyx_GOTREF(__pyx_t_8);
4428  __Pyx_GOTREF(__pyx_t_9);
4429  __pyx_t_7 = __pyx_array_new(__pyx_t_9, sizeof(int), PyBytes_AS_STRING(__pyx_t_8), (char *) "c", (char *) __pyx_t_4);
4430  if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 57, __pyx_L1_error)
4431  __Pyx_GOTREF(__pyx_t_7);
4432  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
4433  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
4434  __pyx_t_8 = NULL;
4435  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
4436  __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_2);
4437  if (likely(__pyx_t_8)) {
4438  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
4439  __Pyx_INCREF(__pyx_t_8);
4440  __Pyx_INCREF(function);
4441  __Pyx_DECREF_SET(__pyx_t_2, function);
4442  }
4443  }
4444  __pyx_t_5 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_8, ((PyObject *)__pyx_t_7)) : __Pyx_PyObject_CallOneArg(__pyx_t_2, ((PyObject *)__pyx_t_7));
4445  __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
4446  __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
4447  if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 57, __pyx_L1_error)
4448  __Pyx_GOTREF(__pyx_t_5);
4449  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4450 
4451  /* "cpartitioning.pyx":58
4452  * np.asarray(<int[:cmesh.mesh.subdomainp.nElements_global]> cmesh.mesh.elementNumbering_subdomain2global),
4453  * np.asarray(<int[:comm.size+1]> cmesh.mesh.nodeOffsets_subdomain_owned),
4454  * np.asarray(<int[:cmesh.mesh.subdomainp.nNodes_global]> cmesh.mesh.nodeNumbering_subdomain2global), # <<<<<<<<<<<<<<
4455  * np.asarray(<int[:comm.size+1]> cmesh.mesh.elementBoundaryOffsets_subdomain_owned),
4456  * np.asarray(<int[:cmesh.mesh.subdomainp.nElementBoundaries_global]> cmesh.mesh.elementBoundaryNumbering_subdomain2global),
4457  */
4458  __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 58, __pyx_L1_error)
4459  __Pyx_GOTREF(__pyx_t_8);
4460  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_asarray); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 58, __pyx_L1_error)
4461  __Pyx_GOTREF(__pyx_t_9);
4462  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
4463  __pyx_t_4 = __pyx_v_cmesh->mesh.nodeNumbering_subdomain2global;
4464  if (!__pyx_t_4) {
4465  PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
4466  __PYX_ERR(0, 58, __pyx_L1_error)
4467  }
4468  __pyx_t_10 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_int);
4469  __pyx_t_8 = Py_BuildValue((char*) "(" __PYX_BUILD_PY_SSIZE_T ")", ((Py_ssize_t)__pyx_v_cmesh->mesh.subdomainp->nNodes_global));
4470  if (unlikely(!__pyx_t_10 || !__pyx_t_8 || !PyBytes_AsString(__pyx_t_10))) __PYX_ERR(0, 58, __pyx_L1_error)
4471  __Pyx_GOTREF(__pyx_t_10);
4472  __Pyx_GOTREF(__pyx_t_8);
4473  __pyx_t_7 = __pyx_array_new(__pyx_t_8, sizeof(int), PyBytes_AS_STRING(__pyx_t_10), (char *) "c", (char *) __pyx_t_4);
4474  if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 58, __pyx_L1_error)
4475  __Pyx_GOTREF(__pyx_t_7);
4476  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
4477  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
4478  __pyx_t_10 = NULL;
4479  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_9))) {
4480  __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_9);
4481  if (likely(__pyx_t_10)) {
4482  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
4483  __Pyx_INCREF(__pyx_t_10);
4484  __Pyx_INCREF(function);
4485  __Pyx_DECREF_SET(__pyx_t_9, function);
4486  }
4487  }
4488  __pyx_t_2 = (__pyx_t_10) ? __Pyx_PyObject_Call2Args(__pyx_t_9, __pyx_t_10, ((PyObject *)__pyx_t_7)) : __Pyx_PyObject_CallOneArg(__pyx_t_9, ((PyObject *)__pyx_t_7));
4489  __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
4490  __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
4491  if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 58, __pyx_L1_error)
4492  __Pyx_GOTREF(__pyx_t_2);
4493  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
4494 
4495  /* "cpartitioning.pyx":59
4496  * np.asarray(<int[:comm.size+1]> cmesh.mesh.nodeOffsets_subdomain_owned),
4497  * np.asarray(<int[:cmesh.mesh.subdomainp.nNodes_global]> cmesh.mesh.nodeNumbering_subdomain2global),
4498  * np.asarray(<int[:comm.size+1]> cmesh.mesh.elementBoundaryOffsets_subdomain_owned), # <<<<<<<<<<<<<<
4499  * np.asarray(<int[:cmesh.mesh.subdomainp.nElementBoundaries_global]> cmesh.mesh.elementBoundaryNumbering_subdomain2global),
4500  * np.asarray(<int[:comm.size+1]> cmesh.mesh.edgeOffsets_subdomain_owned),
4501  */
4502  __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_n_s_np); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 59, __pyx_L1_error)
4503  __Pyx_GOTREF(__pyx_t_10);
4504  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_asarray); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 59, __pyx_L1_error)
4505  __Pyx_GOTREF(__pyx_t_8);
4506  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
4507  __pyx_t_4 = __pyx_v_cmesh->mesh.elementBoundaryOffsets_subdomain_owned;
4508  __pyx_t_10 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_comm), __pyx_n_s_size); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 59, __pyx_L1_error)
4509  __Pyx_GOTREF(__pyx_t_10);
4510  __pyx_t_11 = __Pyx_PyInt_AddObjC(__pyx_t_10, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 59, __pyx_L1_error)
4511  __Pyx_GOTREF(__pyx_t_11);
4512  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
4513  __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_t_11); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 59, __pyx_L1_error)
4514  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
4515  if (!__pyx_t_4) {
4516  PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
4517  __PYX_ERR(0, 59, __pyx_L1_error)
4518  }
4519  __pyx_t_10 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_int);
4520  __pyx_t_11 = Py_BuildValue((char*) "(" __PYX_BUILD_PY_SSIZE_T ")", ((Py_ssize_t)__pyx_t_6));
4521  if (unlikely(!__pyx_t_10 || !__pyx_t_11 || !PyBytes_AsString(__pyx_t_10))) __PYX_ERR(0, 59, __pyx_L1_error)
4522  __Pyx_GOTREF(__pyx_t_10);
4523  __Pyx_GOTREF(__pyx_t_11);
4524  __pyx_t_7 = __pyx_array_new(__pyx_t_11, sizeof(int), PyBytes_AS_STRING(__pyx_t_10), (char *) "c", (char *) __pyx_t_4);
4525  if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 59, __pyx_L1_error)
4526  __Pyx_GOTREF(__pyx_t_7);
4527  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
4528  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
4529  __pyx_t_10 = NULL;
4530  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_8))) {
4531  __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_8);
4532  if (likely(__pyx_t_10)) {
4533  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
4534  __Pyx_INCREF(__pyx_t_10);
4535  __Pyx_INCREF(function);
4536  __Pyx_DECREF_SET(__pyx_t_8, function);
4537  }
4538  }
4539  __pyx_t_9 = (__pyx_t_10) ? __Pyx_PyObject_Call2Args(__pyx_t_8, __pyx_t_10, ((PyObject *)__pyx_t_7)) : __Pyx_PyObject_CallOneArg(__pyx_t_8, ((PyObject *)__pyx_t_7));
4540  __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
4541  __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
4542  if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 59, __pyx_L1_error)
4543  __Pyx_GOTREF(__pyx_t_9);
4544  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
4545 
4546  /* "cpartitioning.pyx":60
4547  * np.asarray(<int[:cmesh.mesh.subdomainp.nNodes_global]> cmesh.mesh.nodeNumbering_subdomain2global),
4548  * np.asarray(<int[:comm.size+1]> cmesh.mesh.elementBoundaryOffsets_subdomain_owned),
4549  * np.asarray(<int[:cmesh.mesh.subdomainp.nElementBoundaries_global]> cmesh.mesh.elementBoundaryNumbering_subdomain2global), # <<<<<<<<<<<<<<
4550  * np.asarray(<int[:comm.size+1]> cmesh.mesh.edgeOffsets_subdomain_owned),
4551  * np.asarray(<int[:cmesh.mesh.subdomainp.nEdges_global]> cmesh.mesh.edgeNumbering_subdomain2global)
4552  */
4553  __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_n_s_np); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 60, __pyx_L1_error)
4554  __Pyx_GOTREF(__pyx_t_10);
4555  __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_asarray); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 60, __pyx_L1_error)
4556  __Pyx_GOTREF(__pyx_t_11);
4557  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
4558  __pyx_t_4 = __pyx_v_cmesh->mesh.elementBoundaryNumbering_subdomain2global;
4559  if (!__pyx_t_4) {
4560  PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
4561  __PYX_ERR(0, 60, __pyx_L1_error)
4562  }
4563  __pyx_t_12 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_int);
4564  __pyx_t_10 = Py_BuildValue((char*) "(" __PYX_BUILD_PY_SSIZE_T ")", ((Py_ssize_t)__pyx_v_cmesh->mesh.subdomainp->nElementBoundaries_global));
4565  if (unlikely(!__pyx_t_12 || !__pyx_t_10 || !PyBytes_AsString(__pyx_t_12))) __PYX_ERR(0, 60, __pyx_L1_error)
4566  __Pyx_GOTREF(__pyx_t_12);
4567  __Pyx_GOTREF(__pyx_t_10);
4568  __pyx_t_7 = __pyx_array_new(__pyx_t_10, sizeof(int), PyBytes_AS_STRING(__pyx_t_12), (char *) "c", (char *) __pyx_t_4);
4569  if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 60, __pyx_L1_error)
4570  __Pyx_GOTREF(__pyx_t_7);
4571  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
4572  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
4573  __pyx_t_12 = NULL;
4574  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_11))) {
4575  __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_11);
4576  if (likely(__pyx_t_12)) {
4577  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_11);
4578  __Pyx_INCREF(__pyx_t_12);
4579  __Pyx_INCREF(function);
4580  __Pyx_DECREF_SET(__pyx_t_11, function);
4581  }
4582  }
4583  __pyx_t_8 = (__pyx_t_12) ? __Pyx_PyObject_Call2Args(__pyx_t_11, __pyx_t_12, ((PyObject *)__pyx_t_7)) : __Pyx_PyObject_CallOneArg(__pyx_t_11, ((PyObject *)__pyx_t_7));
4584  __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
4585  __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
4586  if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 60, __pyx_L1_error)
4587  __Pyx_GOTREF(__pyx_t_8);
4588  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
4589 
4590  /* "cpartitioning.pyx":61
4591  * np.asarray(<int[:comm.size+1]> cmesh.mesh.elementBoundaryOffsets_subdomain_owned),
4592  * np.asarray(<int[:cmesh.mesh.subdomainp.nElementBoundaries_global]> cmesh.mesh.elementBoundaryNumbering_subdomain2global),
4593  * np.asarray(<int[:comm.size+1]> cmesh.mesh.edgeOffsets_subdomain_owned), # <<<<<<<<<<<<<<
4594  * np.asarray(<int[:cmesh.mesh.subdomainp.nEdges_global]> cmesh.mesh.edgeNumbering_subdomain2global)
4595  * )
4596  */
4597  __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_n_s_np); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 61, __pyx_L1_error)
4598  __Pyx_GOTREF(__pyx_t_12);
4599  __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_asarray); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 61, __pyx_L1_error)
4600  __Pyx_GOTREF(__pyx_t_10);
4601  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
4602  __pyx_t_4 = __pyx_v_cmesh->mesh.edgeOffsets_subdomain_owned;
4603  __pyx_t_12 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_comm), __pyx_n_s_size); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 61, __pyx_L1_error)
4604  __Pyx_GOTREF(__pyx_t_12);
4605  __pyx_t_13 = __Pyx_PyInt_AddObjC(__pyx_t_12, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 61, __pyx_L1_error)
4606  __Pyx_GOTREF(__pyx_t_13);
4607  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
4608  __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_t_13); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 61, __pyx_L1_error)
4609  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
4610  if (!__pyx_t_4) {
4611  PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
4612  __PYX_ERR(0, 61, __pyx_L1_error)
4613  }
4614  __pyx_t_12 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_int);
4615  __pyx_t_13 = Py_BuildValue((char*) "(" __PYX_BUILD_PY_SSIZE_T ")", ((Py_ssize_t)__pyx_t_6));
4616  if (unlikely(!__pyx_t_12 || !__pyx_t_13 || !PyBytes_AsString(__pyx_t_12))) __PYX_ERR(0, 61, __pyx_L1_error)
4617  __Pyx_GOTREF(__pyx_t_12);
4618  __Pyx_GOTREF(__pyx_t_13);
4619  __pyx_t_7 = __pyx_array_new(__pyx_t_13, sizeof(int), PyBytes_AS_STRING(__pyx_t_12), (char *) "c", (char *) __pyx_t_4);
4620  if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 61, __pyx_L1_error)
4621  __Pyx_GOTREF(__pyx_t_7);
4622  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
4623  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
4624  __pyx_t_12 = NULL;
4625  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_10))) {
4626  __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_10);
4627  if (likely(__pyx_t_12)) {
4628  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10);
4629  __Pyx_INCREF(__pyx_t_12);
4630  __Pyx_INCREF(function);
4631  __Pyx_DECREF_SET(__pyx_t_10, function);
4632  }
4633  }
4634  __pyx_t_11 = (__pyx_t_12) ? __Pyx_PyObject_Call2Args(__pyx_t_10, __pyx_t_12, ((PyObject *)__pyx_t_7)) : __Pyx_PyObject_CallOneArg(__pyx_t_10, ((PyObject *)__pyx_t_7));
4635  __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
4636  __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
4637  if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 61, __pyx_L1_error)
4638  __Pyx_GOTREF(__pyx_t_11);
4639  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
4640 
4641  /* "cpartitioning.pyx":62
4642  * np.asarray(<int[:cmesh.mesh.subdomainp.nElementBoundaries_global]> cmesh.mesh.elementBoundaryNumbering_subdomain2global),
4643  * np.asarray(<int[:comm.size+1]> cmesh.mesh.edgeOffsets_subdomain_owned),
4644  * np.asarray(<int[:cmesh.mesh.subdomainp.nEdges_global]> cmesh.mesh.edgeNumbering_subdomain2global) # <<<<<<<<<<<<<<
4645  * )
4646  *
4647  */
4648  __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_n_s_np); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 62, __pyx_L1_error)
4649  __Pyx_GOTREF(__pyx_t_12);
4650  __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_asarray); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 62, __pyx_L1_error)
4651  __Pyx_GOTREF(__pyx_t_13);
4652  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
4653  __pyx_t_4 = __pyx_v_cmesh->mesh.edgeNumbering_subdomain2global;
4654  if (!__pyx_t_4) {
4655  PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
4656  __PYX_ERR(0, 62, __pyx_L1_error)
4657  }
4658  __pyx_t_14 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_int);
4659  __pyx_t_12 = Py_BuildValue((char*) "(" __PYX_BUILD_PY_SSIZE_T ")", ((Py_ssize_t)__pyx_v_cmesh->mesh.subdomainp->nEdges_global));
4660  if (unlikely(!__pyx_t_14 || !__pyx_t_12 || !PyBytes_AsString(__pyx_t_14))) __PYX_ERR(0, 62, __pyx_L1_error)
4661  __Pyx_GOTREF(__pyx_t_14);
4662  __Pyx_GOTREF(__pyx_t_12);
4663  __pyx_t_7 = __pyx_array_new(__pyx_t_12, sizeof(int), PyBytes_AS_STRING(__pyx_t_14), (char *) "c", (char *) __pyx_t_4);
4664  if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 62, __pyx_L1_error)
4665  __Pyx_GOTREF(__pyx_t_7);
4666  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
4667  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
4668  __pyx_t_14 = NULL;
4669  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_13))) {
4670  __pyx_t_14 = PyMethod_GET_SELF(__pyx_t_13);
4671  if (likely(__pyx_t_14)) {
4672  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_13);
4673  __Pyx_INCREF(__pyx_t_14);
4674  __Pyx_INCREF(function);
4675  __Pyx_DECREF_SET(__pyx_t_13, function);
4676  }
4677  }
4678  __pyx_t_10 = (__pyx_t_14) ? __Pyx_PyObject_Call2Args(__pyx_t_13, __pyx_t_14, ((PyObject *)__pyx_t_7)) : __Pyx_PyObject_CallOneArg(__pyx_t_13, ((PyObject *)__pyx_t_7));
4679  __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
4680  __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
4681  if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 62, __pyx_L1_error)
4682  __Pyx_GOTREF(__pyx_t_10);
4683  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
4684 
4685  /* "cpartitioning.pyx":55
4686  * cmesh.mesh.subdomainp = &subdomain_cmesh.mesh
4687  * return (
4688  * np.asarray(<int[:comm.size+1]> cmesh.mesh.elementOffsets_subdomain_owned), # <<<<<<<<<<<<<<
4689  * np.asarray(<int[:cmesh.mesh.subdomainp.nElements_global]> cmesh.mesh.elementNumbering_subdomain2global),
4690  * np.asarray(<int[:comm.size+1]> cmesh.mesh.nodeOffsets_subdomain_owned),
4691  */
4692  __pyx_t_13 = PyTuple_New(8); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 55, __pyx_L1_error)
4693  __Pyx_GOTREF(__pyx_t_13);
4694  __Pyx_GIVEREF(__pyx_t_1);
4695  PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_1);
4696  __Pyx_GIVEREF(__pyx_t_3);
4697  PyTuple_SET_ITEM(__pyx_t_13, 1, __pyx_t_3);
4698  __Pyx_GIVEREF(__pyx_t_5);
4699  PyTuple_SET_ITEM(__pyx_t_13, 2, __pyx_t_5);
4700  __Pyx_GIVEREF(__pyx_t_2);
4701  PyTuple_SET_ITEM(__pyx_t_13, 3, __pyx_t_2);
4702  __Pyx_GIVEREF(__pyx_t_9);
4703  PyTuple_SET_ITEM(__pyx_t_13, 4, __pyx_t_9);
4704  __Pyx_GIVEREF(__pyx_t_8);
4705  PyTuple_SET_ITEM(__pyx_t_13, 5, __pyx_t_8);
4706  __Pyx_GIVEREF(__pyx_t_11);
4707  PyTuple_SET_ITEM(__pyx_t_13, 6, __pyx_t_11);
4708  __Pyx_GIVEREF(__pyx_t_10);
4709  PyTuple_SET_ITEM(__pyx_t_13, 7, __pyx_t_10);
4710  __pyx_t_1 = 0;
4711  __pyx_t_3 = 0;
4712  __pyx_t_5 = 0;
4713  __pyx_t_2 = 0;
4714  __pyx_t_9 = 0;
4715  __pyx_t_8 = 0;
4716  __pyx_t_11 = 0;
4717  __pyx_t_10 = 0;
4718  __pyx_r = __pyx_t_13;
4719  __pyx_t_13 = 0;
4720  goto __pyx_L0;
4721 
4722  /* "cpartitioning.pyx":51
4723  * )
4724  *
4725  * def convertPUMIPartitionToPython(Comm comm, cmeshTools.CMesh cmesh, cmeshTools.CMesh subdomain_cmesh): # <<<<<<<<<<<<<<
4726  * #need to have Python handles for the cmesh arrays created from apf/PUMI mesh
4727  * cmesh.mesh.subdomainp = &subdomain_cmesh.mesh
4728  */
4729 
4730  /* function exit code */
4731  __pyx_L1_error:;
4732  __Pyx_XDECREF(__pyx_t_1);
4733  __Pyx_XDECREF(__pyx_t_2);
4734  __Pyx_XDECREF(__pyx_t_3);
4735  __Pyx_XDECREF(__pyx_t_5);
4736  __Pyx_XDECREF(((PyObject *)__pyx_t_7));
4737  __Pyx_XDECREF(__pyx_t_8);
4738  __Pyx_XDECREF(__pyx_t_9);
4739  __Pyx_XDECREF(__pyx_t_10);
4740  __Pyx_XDECREF(__pyx_t_11);
4741  __Pyx_XDECREF(__pyx_t_12);
4742  __Pyx_XDECREF(__pyx_t_13);
4743  __Pyx_XDECREF(__pyx_t_14);
4744  __Pyx_AddTraceback("cpartitioning.convertPUMIPartitionToPython", __pyx_clineno, __pyx_lineno, __pyx_filename);
4745  __pyx_r = NULL;
4746  __pyx_L0:;
4747  __Pyx_XGIVEREF(__pyx_r);
4748  __Pyx_RefNannyFinishContext();
4749  return __pyx_r;
4750 }
4751 
4752 /* "cpartitioning.pyx":65
4753  * )
4754  *
4755  * def partitionNodesFromTetgenFiles(Comm comm, object filebase, int indexBase, int nLayersOfOverlap, cmeshTools.CMesh cmesh, cmeshTools.CMesh subdomain_cmesh): # <<<<<<<<<<<<<<
4756  * cmesh.mesh.subdomainp = &subdomain_cmesh.mesh
4757  * if not isinstance(filebase, bytes):
4758  */
4759 
4760 /* Python wrapper */
4761 static PyObject *__pyx_pw_13cpartitioning_7partitionNodesFromTetgenFiles(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
4762 static PyMethodDef __pyx_mdef_13cpartitioning_7partitionNodesFromTetgenFiles = {"partitionNodesFromTetgenFiles", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_13cpartitioning_7partitionNodesFromTetgenFiles, METH_VARARGS|METH_KEYWORDS, 0};
4763 static PyObject *__pyx_pw_13cpartitioning_7partitionNodesFromTetgenFiles(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
4764  struct PyMPICommObject *__pyx_v_comm = 0;
4765  PyObject *__pyx_v_filebase = 0;
4766  int __pyx_v_indexBase;
4767  int __pyx_v_nLayersOfOverlap;
4768  struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_cmesh = 0;
4769  struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_subdomain_cmesh = 0;
4770  PyObject *__pyx_r = 0;
4771  __Pyx_RefNannyDeclarations
4772  __Pyx_RefNannySetupContext("partitionNodesFromTetgenFiles (wrapper)", 0);
4773  {
4774  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_comm,&__pyx_n_s_filebase,&__pyx_n_s_indexBase,&__pyx_n_s_nLayersOfOverlap,&__pyx_n_s_cmesh,&__pyx_n_s_subdomain_cmesh,0};
4775  PyObject* values[6] = {0,0,0,0,0,0};
4776  if (unlikely(__pyx_kwds)) {
4777  Py_ssize_t kw_args;
4778  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
4779  switch (pos_args) {
4780  case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
4781  CYTHON_FALLTHROUGH;
4782  case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
4783  CYTHON_FALLTHROUGH;
4784  case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
4785  CYTHON_FALLTHROUGH;
4786  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
4787  CYTHON_FALLTHROUGH;
4788  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4789  CYTHON_FALLTHROUGH;
4790  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4791  CYTHON_FALLTHROUGH;
4792  case 0: break;
4793  default: goto __pyx_L5_argtuple_error;
4794  }
4795  kw_args = PyDict_Size(__pyx_kwds);
4796  switch (pos_args) {
4797  case 0:
4798  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_comm)) != 0)) kw_args--;
4799  else goto __pyx_L5_argtuple_error;
4800  CYTHON_FALLTHROUGH;
4801  case 1:
4802  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_filebase)) != 0)) kw_args--;
4803  else {
4804  __Pyx_RaiseArgtupleInvalid("partitionNodesFromTetgenFiles", 1, 6, 6, 1); __PYX_ERR(0, 65, __pyx_L3_error)
4805  }
4806  CYTHON_FALLTHROUGH;
4807  case 2:
4808  if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_indexBase)) != 0)) kw_args--;
4809  else {
4810  __Pyx_RaiseArgtupleInvalid("partitionNodesFromTetgenFiles", 1, 6, 6, 2); __PYX_ERR(0, 65, __pyx_L3_error)
4811  }
4812  CYTHON_FALLTHROUGH;
4813  case 3:
4814  if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nLayersOfOverlap)) != 0)) kw_args--;
4815  else {
4816  __Pyx_RaiseArgtupleInvalid("partitionNodesFromTetgenFiles", 1, 6, 6, 3); __PYX_ERR(0, 65, __pyx_L3_error)
4817  }
4818  CYTHON_FALLTHROUGH;
4819  case 4:
4820  if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_cmesh)) != 0)) kw_args--;
4821  else {
4822  __Pyx_RaiseArgtupleInvalid("partitionNodesFromTetgenFiles", 1, 6, 6, 4); __PYX_ERR(0, 65, __pyx_L3_error)
4823  }
4824  CYTHON_FALLTHROUGH;
4825  case 5:
4826  if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_subdomain_cmesh)) != 0)) kw_args--;
4827  else {
4828  __Pyx_RaiseArgtupleInvalid("partitionNodesFromTetgenFiles", 1, 6, 6, 5); __PYX_ERR(0, 65, __pyx_L3_error)
4829  }
4830  }
4831  if (unlikely(kw_args > 0)) {
4832  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "partitionNodesFromTetgenFiles") < 0)) __PYX_ERR(0, 65, __pyx_L3_error)
4833  }
4834  } else if (PyTuple_GET_SIZE(__pyx_args) != 6) {
4835  goto __pyx_L5_argtuple_error;
4836  } else {
4837  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4838  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4839  values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
4840  values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
4841  values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
4842  values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
4843  }
4844  __pyx_v_comm = ((struct PyMPICommObject *)values[0]);
4845  __pyx_v_filebase = values[1];
4846  __pyx_v_indexBase = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_indexBase == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 65, __pyx_L3_error)
4847  __pyx_v_nLayersOfOverlap = __Pyx_PyInt_As_int(values[3]); if (unlikely((__pyx_v_nLayersOfOverlap == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 65, __pyx_L3_error)
4848  __pyx_v_cmesh = ((struct __pyx_obj_7proteus_10cmeshTools_CMesh *)values[4]);
4849  __pyx_v_subdomain_cmesh = ((struct __pyx_obj_7proteus_10cmeshTools_CMesh *)values[5]);
4850  }
4851  goto __pyx_L4_argument_unpacking_done;
4852  __pyx_L5_argtuple_error:;
4853  __Pyx_RaiseArgtupleInvalid("partitionNodesFromTetgenFiles", 1, 6, 6, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 65, __pyx_L3_error)
4854  __pyx_L3_error:;
4855  __Pyx_AddTraceback("cpartitioning.partitionNodesFromTetgenFiles", __pyx_clineno, __pyx_lineno, __pyx_filename);
4856  __Pyx_RefNannyFinishContext();
4857  return NULL;
4858  __pyx_L4_argument_unpacking_done:;
4859  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_comm), __pyx_ptype_6mpi4py_3MPI_Comm, 1, "comm", 0))) __PYX_ERR(0, 65, __pyx_L1_error)
4860  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_cmesh), __pyx_ptype_7proteus_10cmeshTools_CMesh, 1, "cmesh", 0))) __PYX_ERR(0, 65, __pyx_L1_error)
4861  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_subdomain_cmesh), __pyx_ptype_7proteus_10cmeshTools_CMesh, 1, "subdomain_cmesh", 0))) __PYX_ERR(0, 65, __pyx_L1_error)
4862  __pyx_r = __pyx_pf_13cpartitioning_6partitionNodesFromTetgenFiles(__pyx_self, __pyx_v_comm, __pyx_v_filebase, __pyx_v_indexBase, __pyx_v_nLayersOfOverlap, __pyx_v_cmesh, __pyx_v_subdomain_cmesh);
4863 
4864  /* function exit code */
4865  goto __pyx_L0;
4866  __pyx_L1_error:;
4867  __pyx_r = NULL;
4868  __pyx_L0:;
4869  __Pyx_RefNannyFinishContext();
4870  return __pyx_r;
4871 }
4872 
4873 static PyObject *__pyx_pf_13cpartitioning_6partitionNodesFromTetgenFiles(CYTHON_UNUSED PyObject *__pyx_self, struct PyMPICommObject *__pyx_v_comm, PyObject *__pyx_v_filebase, int __pyx_v_indexBase, int __pyx_v_nLayersOfOverlap, struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_cmesh, struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_subdomain_cmesh) {
4874  PyObject *__pyx_r = NULL;
4875  __Pyx_RefNannyDeclarations
4876  int __pyx_t_1;
4877  int __pyx_t_2;
4878  PyObject *__pyx_t_3 = NULL;
4879  PyObject *__pyx_t_4 = NULL;
4880  PyObject *__pyx_t_5 = NULL;
4881  char *__pyx_t_6;
4882  int *__pyx_t_7;
4883  PyObject *__pyx_t_8 = NULL;
4884  Py_ssize_t __pyx_t_9;
4885  struct __pyx_array_obj *__pyx_t_10 = NULL;
4886  PyObject *__pyx_t_11 = NULL;
4887  PyObject *__pyx_t_12 = NULL;
4888  PyObject *__pyx_t_13 = NULL;
4889  PyObject *__pyx_t_14 = NULL;
4890  PyObject *__pyx_t_15 = NULL;
4891  PyObject *__pyx_t_16 = NULL;
4892  PyObject *__pyx_t_17 = NULL;
4893  __Pyx_RefNannySetupContext("partitionNodesFromTetgenFiles", 0);
4894  __Pyx_INCREF(__pyx_v_filebase);
4895 
4896  /* "cpartitioning.pyx":66
4897  *
4898  * def partitionNodesFromTetgenFiles(Comm comm, object filebase, int indexBase, int nLayersOfOverlap, cmeshTools.CMesh cmesh, cmeshTools.CMesh subdomain_cmesh):
4899  * cmesh.mesh.subdomainp = &subdomain_cmesh.mesh # <<<<<<<<<<<<<<
4900  * if not isinstance(filebase, bytes):
4901  * filebase = filebase.encode()
4902  */
4903  __pyx_v_cmesh->mesh.subdomainp = (&__pyx_v_subdomain_cmesh->mesh);
4904 
4905  /* "cpartitioning.pyx":67
4906  * def partitionNodesFromTetgenFiles(Comm comm, object filebase, int indexBase, int nLayersOfOverlap, cmeshTools.CMesh cmesh, cmeshTools.CMesh subdomain_cmesh):
4907  * cmesh.mesh.subdomainp = &subdomain_cmesh.mesh
4908  * if not isinstance(filebase, bytes): # <<<<<<<<<<<<<<
4909  * filebase = filebase.encode()
4910  * c_partitionNodesFromTetgenFiles(comm.ob_mpi,
4911  */
4912  __pyx_t_1 = PyBytes_Check(__pyx_v_filebase);
4913  __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
4914  if (__pyx_t_2) {
4915 
4916  /* "cpartitioning.pyx":68
4917  * cmesh.mesh.subdomainp = &subdomain_cmesh.mesh
4918  * if not isinstance(filebase, bytes):
4919  * filebase = filebase.encode() # <<<<<<<<<<<<<<
4920  * c_partitionNodesFromTetgenFiles(comm.ob_mpi,
4921  * <const char*>(<char*>filebase),
4922  */
4923  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_filebase, __pyx_n_s_encode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 68, __pyx_L1_error)
4924  __Pyx_GOTREF(__pyx_t_4);
4925  __pyx_t_5 = NULL;
4926  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
4927  __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
4928  if (likely(__pyx_t_5)) {
4929  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
4930  __Pyx_INCREF(__pyx_t_5);
4931  __Pyx_INCREF(function);
4932  __Pyx_DECREF_SET(__pyx_t_4, function);
4933  }
4934  }
4935  __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_4);
4936  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
4937  if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 68, __pyx_L1_error)
4938  __Pyx_GOTREF(__pyx_t_3);
4939  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4940  __Pyx_DECREF_SET(__pyx_v_filebase, __pyx_t_3);
4941  __pyx_t_3 = 0;
4942 
4943  /* "cpartitioning.pyx":67
4944  * def partitionNodesFromTetgenFiles(Comm comm, object filebase, int indexBase, int nLayersOfOverlap, cmeshTools.CMesh cmesh, cmeshTools.CMesh subdomain_cmesh):
4945  * cmesh.mesh.subdomainp = &subdomain_cmesh.mesh
4946  * if not isinstance(filebase, bytes): # <<<<<<<<<<<<<<
4947  * filebase = filebase.encode()
4948  * c_partitionNodesFromTetgenFiles(comm.ob_mpi,
4949  */
4950  }
4951 
4952  /* "cpartitioning.pyx":70
4953  * filebase = filebase.encode()
4954  * c_partitionNodesFromTetgenFiles(comm.ob_mpi,
4955  * <const char*>(<char*>filebase), # <<<<<<<<<<<<<<
4956  * indexBase,
4957  * cmesh.mesh,
4958  */
4959  __pyx_t_6 = __Pyx_PyObject_AsWritableString(__pyx_v_filebase); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) __PYX_ERR(0, 70, __pyx_L1_error)
4960 
4961  /* "cpartitioning.pyx":69
4962  * if not isinstance(filebase, bytes):
4963  * filebase = filebase.encode()
4964  * c_partitionNodesFromTetgenFiles(comm.ob_mpi, # <<<<<<<<<<<<<<
4965  * <const char*>(<char*>filebase),
4966  * indexBase,
4967  */
4968  (void)(proteus::partitionNodesFromTetgenFiles(__pyx_v_comm->ob_mpi, ((char const *)((char *)__pyx_t_6)), __pyx_v_indexBase, __pyx_v_cmesh->mesh, __pyx_v_nLayersOfOverlap));
4969 
4970  /* "cpartitioning.pyx":74
4971  * cmesh.mesh,
4972  * nLayersOfOverlap)
4973  * return ( # <<<<<<<<<<<<<<
4974  * np.asarray(<int[:comm.size+1]> cmesh.mesh.elementOffsets_subdomain_owned),
4975  * np.asarray(<int[:cmesh.mesh.subdomainp.nElements_global]> cmesh.mesh.elementNumbering_subdomain2global),
4976  */
4977  __Pyx_XDECREF(__pyx_r);
4978 
4979  /* "cpartitioning.pyx":75
4980  * nLayersOfOverlap)
4981  * return (
4982  * np.asarray(<int[:comm.size+1]> cmesh.mesh.elementOffsets_subdomain_owned), # <<<<<<<<<<<<<<
4983  * np.asarray(<int[:cmesh.mesh.subdomainp.nElements_global]> cmesh.mesh.elementNumbering_subdomain2global),
4984  * np.asarray(<int[:comm.size+1]> cmesh.mesh.nodeOffsets_subdomain_owned),
4985  */
4986  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 75, __pyx_L1_error)
4987  __Pyx_GOTREF(__pyx_t_4);
4988  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_asarray); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 75, __pyx_L1_error)
4989  __Pyx_GOTREF(__pyx_t_5);
4990  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4991  __pyx_t_7 = __pyx_v_cmesh->mesh.elementOffsets_subdomain_owned;
4992  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_comm), __pyx_n_s_size); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 75, __pyx_L1_error)
4993  __Pyx_GOTREF(__pyx_t_4);
4994  __pyx_t_8 = __Pyx_PyInt_AddObjC(__pyx_t_4, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 75, __pyx_L1_error)
4995  __Pyx_GOTREF(__pyx_t_8);
4996  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4997  __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_8); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 75, __pyx_L1_error)
4998  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
4999  if (!__pyx_t_7) {
5000  PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
5001  __PYX_ERR(0, 75, __pyx_L1_error)
5002  }
5003  __pyx_t_4 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_int);
5004  __pyx_t_8 = Py_BuildValue((char*) "(" __PYX_BUILD_PY_SSIZE_T ")", ((Py_ssize_t)__pyx_t_9));
5005  if (unlikely(!__pyx_t_4 || !__pyx_t_8 || !PyBytes_AsString(__pyx_t_4))) __PYX_ERR(0, 75, __pyx_L1_error)
5006  __Pyx_GOTREF(__pyx_t_4);
5007  __Pyx_GOTREF(__pyx_t_8);
5008  __pyx_t_10 = __pyx_array_new(__pyx_t_8, sizeof(int), PyBytes_AS_STRING(__pyx_t_4), (char *) "c", (char *) __pyx_t_7);
5009  if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 75, __pyx_L1_error)
5010  __Pyx_GOTREF(__pyx_t_10);
5011  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
5012  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5013  __pyx_t_4 = NULL;
5014  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
5015  __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5);
5016  if (likely(__pyx_t_4)) {
5017  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
5018  __Pyx_INCREF(__pyx_t_4);
5019  __Pyx_INCREF(function);
5020  __Pyx_DECREF_SET(__pyx_t_5, function);
5021  }
5022  }
5023  __pyx_t_3 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_4, ((PyObject *)__pyx_t_10)) : __Pyx_PyObject_CallOneArg(__pyx_t_5, ((PyObject *)__pyx_t_10));
5024  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
5025  __Pyx_DECREF(((PyObject *)__pyx_t_10)); __pyx_t_10 = 0;
5026  if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 75, __pyx_L1_error)
5027  __Pyx_GOTREF(__pyx_t_3);
5028  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
5029 
5030  /* "cpartitioning.pyx":76
5031  * return (
5032  * np.asarray(<int[:comm.size+1]> cmesh.mesh.elementOffsets_subdomain_owned),
5033  * np.asarray(<int[:cmesh.mesh.subdomainp.nElements_global]> cmesh.mesh.elementNumbering_subdomain2global), # <<<<<<<<<<<<<<
5034  * np.asarray(<int[:comm.size+1]> cmesh.mesh.nodeOffsets_subdomain_owned),
5035  * np.asarray(<int[:cmesh.mesh.subdomainp.nNodes_global]> cmesh.mesh.nodeNumbering_subdomain2global),
5036  */
5037  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 76, __pyx_L1_error)
5038  __Pyx_GOTREF(__pyx_t_4);
5039  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_asarray); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 76, __pyx_L1_error)
5040  __Pyx_GOTREF(__pyx_t_8);
5041  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5042  __pyx_t_7 = __pyx_v_cmesh->mesh.elementNumbering_subdomain2global;
5043  if (!__pyx_t_7) {
5044  PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
5045  __PYX_ERR(0, 76, __pyx_L1_error)
5046  }
5047  __pyx_t_11 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_int);
5048  __pyx_t_4 = Py_BuildValue((char*) "(" __PYX_BUILD_PY_SSIZE_T ")", ((Py_ssize_t)__pyx_v_cmesh->mesh.subdomainp->nElements_global));
5049  if (unlikely(!__pyx_t_11 || !__pyx_t_4 || !PyBytes_AsString(__pyx_t_11))) __PYX_ERR(0, 76, __pyx_L1_error)
5050  __Pyx_GOTREF(__pyx_t_11);
5051  __Pyx_GOTREF(__pyx_t_4);
5052  __pyx_t_10 = __pyx_array_new(__pyx_t_4, sizeof(int), PyBytes_AS_STRING(__pyx_t_11), (char *) "c", (char *) __pyx_t_7);
5053  if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 76, __pyx_L1_error)
5054  __Pyx_GOTREF(__pyx_t_10);
5055  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5056  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
5057  __pyx_t_11 = NULL;
5058  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_8))) {
5059  __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_8);
5060  if (likely(__pyx_t_11)) {
5061  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
5062  __Pyx_INCREF(__pyx_t_11);
5063  __Pyx_INCREF(function);
5064  __Pyx_DECREF_SET(__pyx_t_8, function);
5065  }
5066  }
5067  __pyx_t_5 = (__pyx_t_11) ? __Pyx_PyObject_Call2Args(__pyx_t_8, __pyx_t_11, ((PyObject *)__pyx_t_10)) : __Pyx_PyObject_CallOneArg(__pyx_t_8, ((PyObject *)__pyx_t_10));
5068  __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
5069  __Pyx_DECREF(((PyObject *)__pyx_t_10)); __pyx_t_10 = 0;
5070  if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 76, __pyx_L1_error)
5071  __Pyx_GOTREF(__pyx_t_5);
5072  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
5073 
5074  /* "cpartitioning.pyx":77
5075  * np.asarray(<int[:comm.size+1]> cmesh.mesh.elementOffsets_subdomain_owned),
5076  * np.asarray(<int[:cmesh.mesh.subdomainp.nElements_global]> cmesh.mesh.elementNumbering_subdomain2global),
5077  * np.asarray(<int[:comm.size+1]> cmesh.mesh.nodeOffsets_subdomain_owned), # <<<<<<<<<<<<<<
5078  * np.asarray(<int[:cmesh.mesh.subdomainp.nNodes_global]> cmesh.mesh.nodeNumbering_subdomain2global),
5079  * np.asarray(<int[:comm.size+1]> cmesh.mesh.elementBoundaryOffsets_subdomain_owned),
5080  */
5081  __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_n_s_np); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 77, __pyx_L1_error)
5082  __Pyx_GOTREF(__pyx_t_11);
5083  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_asarray); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 77, __pyx_L1_error)
5084  __Pyx_GOTREF(__pyx_t_4);
5085  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
5086  __pyx_t_7 = __pyx_v_cmesh->mesh.nodeOffsets_subdomain_owned;
5087  __pyx_t_11 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_comm), __pyx_n_s_size); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 77, __pyx_L1_error)
5088  __Pyx_GOTREF(__pyx_t_11);
5089  __pyx_t_12 = __Pyx_PyInt_AddObjC(__pyx_t_11, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 77, __pyx_L1_error)
5090  __Pyx_GOTREF(__pyx_t_12);
5091  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
5092  __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_12); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 77, __pyx_L1_error)
5093  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
5094  if (!__pyx_t_7) {
5095  PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
5096  __PYX_ERR(0, 77, __pyx_L1_error)
5097  }
5098  __pyx_t_11 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_int);
5099  __pyx_t_12 = Py_BuildValue((char*) "(" __PYX_BUILD_PY_SSIZE_T ")", ((Py_ssize_t)__pyx_t_9));
5100  if (unlikely(!__pyx_t_11 || !__pyx_t_12 || !PyBytes_AsString(__pyx_t_11))) __PYX_ERR(0, 77, __pyx_L1_error)
5101  __Pyx_GOTREF(__pyx_t_11);
5102  __Pyx_GOTREF(__pyx_t_12);
5103  __pyx_t_10 = __pyx_array_new(__pyx_t_12, sizeof(int), PyBytes_AS_STRING(__pyx_t_11), (char *) "c", (char *) __pyx_t_7);
5104  if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 77, __pyx_L1_error)
5105  __Pyx_GOTREF(__pyx_t_10);
5106  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
5107  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
5108  __pyx_t_11 = NULL;
5109  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
5110  __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_4);
5111  if (likely(__pyx_t_11)) {
5112  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
5113  __Pyx_INCREF(__pyx_t_11);
5114  __Pyx_INCREF(function);
5115  __Pyx_DECREF_SET(__pyx_t_4, function);
5116  }
5117  }
5118  __pyx_t_8 = (__pyx_t_11) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_11, ((PyObject *)__pyx_t_10)) : __Pyx_PyObject_CallOneArg(__pyx_t_4, ((PyObject *)__pyx_t_10));
5119  __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
5120  __Pyx_DECREF(((PyObject *)__pyx_t_10)); __pyx_t_10 = 0;
5121  if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 77, __pyx_L1_error)
5122  __Pyx_GOTREF(__pyx_t_8);
5123  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5124 
5125  /* "cpartitioning.pyx":78
5126  * np.asarray(<int[:cmesh.mesh.subdomainp.nElements_global]> cmesh.mesh.elementNumbering_subdomain2global),
5127  * np.asarray(<int[:comm.size+1]> cmesh.mesh.nodeOffsets_subdomain_owned),
5128  * np.asarray(<int[:cmesh.mesh.subdomainp.nNodes_global]> cmesh.mesh.nodeNumbering_subdomain2global), # <<<<<<<<<<<<<<
5129  * np.asarray(<int[:comm.size+1]> cmesh.mesh.elementBoundaryOffsets_subdomain_owned),
5130  * np.asarray(<int[:cmesh.mesh.subdomainp.nElementBoundaries_global]> cmesh.mesh.elementBoundaryNumbering_subdomain2global),
5131  */
5132  __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_n_s_np); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 78, __pyx_L1_error)
5133  __Pyx_GOTREF(__pyx_t_11);
5134  __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_asarray); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 78, __pyx_L1_error)
5135  __Pyx_GOTREF(__pyx_t_12);
5136  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
5137  __pyx_t_7 = __pyx_v_cmesh->mesh.nodeNumbering_subdomain2global;
5138  if (!__pyx_t_7) {
5139  PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
5140  __PYX_ERR(0, 78, __pyx_L1_error)
5141  }
5142  __pyx_t_13 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_int);
5143  __pyx_t_11 = Py_BuildValue((char*) "(" __PYX_BUILD_PY_SSIZE_T ")", ((Py_ssize_t)__pyx_v_cmesh->mesh.subdomainp->nNodes_global));
5144  if (unlikely(!__pyx_t_13 || !__pyx_t_11 || !PyBytes_AsString(__pyx_t_13))) __PYX_ERR(0, 78, __pyx_L1_error)
5145  __Pyx_GOTREF(__pyx_t_13);
5146  __Pyx_GOTREF(__pyx_t_11);
5147  __pyx_t_10 = __pyx_array_new(__pyx_t_11, sizeof(int), PyBytes_AS_STRING(__pyx_t_13), (char *) "c", (char *) __pyx_t_7);
5148  if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 78, __pyx_L1_error)
5149  __Pyx_GOTREF(__pyx_t_10);
5150  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
5151  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
5152  __pyx_t_13 = NULL;
5153  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_12))) {
5154  __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_12);
5155  if (likely(__pyx_t_13)) {
5156  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12);
5157  __Pyx_INCREF(__pyx_t_13);
5158  __Pyx_INCREF(function);
5159  __Pyx_DECREF_SET(__pyx_t_12, function);
5160  }
5161  }
5162  __pyx_t_4 = (__pyx_t_13) ? __Pyx_PyObject_Call2Args(__pyx_t_12, __pyx_t_13, ((PyObject *)__pyx_t_10)) : __Pyx_PyObject_CallOneArg(__pyx_t_12, ((PyObject *)__pyx_t_10));
5163  __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
5164  __Pyx_DECREF(((PyObject *)__pyx_t_10)); __pyx_t_10 = 0;
5165  if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 78, __pyx_L1_error)
5166  __Pyx_GOTREF(__pyx_t_4);
5167  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
5168 
5169  /* "cpartitioning.pyx":79
5170  * np.asarray(<int[:comm.size+1]> cmesh.mesh.nodeOffsets_subdomain_owned),
5171  * np.asarray(<int[:cmesh.mesh.subdomainp.nNodes_global]> cmesh.mesh.nodeNumbering_subdomain2global),
5172  * np.asarray(<int[:comm.size+1]> cmesh.mesh.elementBoundaryOffsets_subdomain_owned), # <<<<<<<<<<<<<<
5173  * np.asarray(<int[:cmesh.mesh.subdomainp.nElementBoundaries_global]> cmesh.mesh.elementBoundaryNumbering_subdomain2global),
5174  * np.asarray(<int[:comm.size+1]> cmesh.mesh.edgeOffsets_subdomain_owned),
5175  */
5176  __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_n_s_np); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 79, __pyx_L1_error)
5177  __Pyx_GOTREF(__pyx_t_13);
5178  __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_asarray); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 79, __pyx_L1_error)
5179  __Pyx_GOTREF(__pyx_t_11);
5180  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
5181  __pyx_t_7 = __pyx_v_cmesh->mesh.elementBoundaryOffsets_subdomain_owned;
5182  __pyx_t_13 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_comm), __pyx_n_s_size); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 79, __pyx_L1_error)
5183  __Pyx_GOTREF(__pyx_t_13);
5184  __pyx_t_14 = __Pyx_PyInt_AddObjC(__pyx_t_13, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 79, __pyx_L1_error)
5185  __Pyx_GOTREF(__pyx_t_14);
5186  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
5187  __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_14); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 79, __pyx_L1_error)
5188  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
5189  if (!__pyx_t_7) {
5190  PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
5191  __PYX_ERR(0, 79, __pyx_L1_error)
5192  }
5193  __pyx_t_13 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_int);
5194  __pyx_t_14 = Py_BuildValue((char*) "(" __PYX_BUILD_PY_SSIZE_T ")", ((Py_ssize_t)__pyx_t_9));
5195  if (unlikely(!__pyx_t_13 || !__pyx_t_14 || !PyBytes_AsString(__pyx_t_13))) __PYX_ERR(0, 79, __pyx_L1_error)
5196  __Pyx_GOTREF(__pyx_t_13);
5197  __Pyx_GOTREF(__pyx_t_14);
5198  __pyx_t_10 = __pyx_array_new(__pyx_t_14, sizeof(int), PyBytes_AS_STRING(__pyx_t_13), (char *) "c", (char *) __pyx_t_7);
5199  if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 79, __pyx_L1_error)
5200  __Pyx_GOTREF(__pyx_t_10);
5201  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
5202  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
5203  __pyx_t_13 = NULL;
5204  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_11))) {
5205  __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_11);
5206  if (likely(__pyx_t_13)) {
5207  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_11);
5208  __Pyx_INCREF(__pyx_t_13);
5209  __Pyx_INCREF(function);
5210  __Pyx_DECREF_SET(__pyx_t_11, function);
5211  }
5212  }
5213  __pyx_t_12 = (__pyx_t_13) ? __Pyx_PyObject_Call2Args(__pyx_t_11, __pyx_t_13, ((PyObject *)__pyx_t_10)) : __Pyx_PyObject_CallOneArg(__pyx_t_11, ((PyObject *)__pyx_t_10));
5214  __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
5215  __Pyx_DECREF(((PyObject *)__pyx_t_10)); __pyx_t_10 = 0;
5216  if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 79, __pyx_L1_error)
5217  __Pyx_GOTREF(__pyx_t_12);
5218  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
5219 
5220  /* "cpartitioning.pyx":80
5221  * np.asarray(<int[:cmesh.mesh.subdomainp.nNodes_global]> cmesh.mesh.nodeNumbering_subdomain2global),
5222  * np.asarray(<int[:comm.size+1]> cmesh.mesh.elementBoundaryOffsets_subdomain_owned),
5223  * np.asarray(<int[:cmesh.mesh.subdomainp.nElementBoundaries_global]> cmesh.mesh.elementBoundaryNumbering_subdomain2global), # <<<<<<<<<<<<<<
5224  * np.asarray(<int[:comm.size+1]> cmesh.mesh.edgeOffsets_subdomain_owned),
5225  * np.asarray(<int[:cmesh.mesh.subdomainp.nEdges_global]> cmesh.mesh.edgeNumbering_subdomain2global)
5226  */
5227  __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_n_s_np); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 80, __pyx_L1_error)
5228  __Pyx_GOTREF(__pyx_t_13);
5229  __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_asarray); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 80, __pyx_L1_error)
5230  __Pyx_GOTREF(__pyx_t_14);
5231  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
5232  __pyx_t_7 = __pyx_v_cmesh->mesh.elementBoundaryNumbering_subdomain2global;
5233  if (!__pyx_t_7) {
5234  PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
5235  __PYX_ERR(0, 80, __pyx_L1_error)
5236  }
5237  __pyx_t_15 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_int);
5238  __pyx_t_13 = Py_BuildValue((char*) "(" __PYX_BUILD_PY_SSIZE_T ")", ((Py_ssize_t)__pyx_v_cmesh->mesh.subdomainp->nElementBoundaries_global));
5239  if (unlikely(!__pyx_t_15 || !__pyx_t_13 || !PyBytes_AsString(__pyx_t_15))) __PYX_ERR(0, 80, __pyx_L1_error)
5240  __Pyx_GOTREF(__pyx_t_15);
5241  __Pyx_GOTREF(__pyx_t_13);
5242  __pyx_t_10 = __pyx_array_new(__pyx_t_13, sizeof(int), PyBytes_AS_STRING(__pyx_t_15), (char *) "c", (char *) __pyx_t_7);
5243  if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 80, __pyx_L1_error)
5244  __Pyx_GOTREF(__pyx_t_10);
5245  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
5246  __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
5247  __pyx_t_15 = NULL;
5248  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_14))) {
5249  __pyx_t_15 = PyMethod_GET_SELF(__pyx_t_14);
5250  if (likely(__pyx_t_15)) {
5251  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_14);
5252  __Pyx_INCREF(__pyx_t_15);
5253  __Pyx_INCREF(function);
5254  __Pyx_DECREF_SET(__pyx_t_14, function);
5255  }
5256  }
5257  __pyx_t_11 = (__pyx_t_15) ? __Pyx_PyObject_Call2Args(__pyx_t_14, __pyx_t_15, ((PyObject *)__pyx_t_10)) : __Pyx_PyObject_CallOneArg(__pyx_t_14, ((PyObject *)__pyx_t_10));
5258  __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
5259  __Pyx_DECREF(((PyObject *)__pyx_t_10)); __pyx_t_10 = 0;
5260  if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 80, __pyx_L1_error)
5261  __Pyx_GOTREF(__pyx_t_11);
5262  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
5263 
5264  /* "cpartitioning.pyx":81
5265  * np.asarray(<int[:comm.size+1]> cmesh.mesh.elementBoundaryOffsets_subdomain_owned),
5266  * np.asarray(<int[:cmesh.mesh.subdomainp.nElementBoundaries_global]> cmesh.mesh.elementBoundaryNumbering_subdomain2global),
5267  * np.asarray(<int[:comm.size+1]> cmesh.mesh.edgeOffsets_subdomain_owned), # <<<<<<<<<<<<<<
5268  * np.asarray(<int[:cmesh.mesh.subdomainp.nEdges_global]> cmesh.mesh.edgeNumbering_subdomain2global)
5269  * )
5270  */
5271  __Pyx_GetModuleGlobalName(__pyx_t_15, __pyx_n_s_np); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 81, __pyx_L1_error)
5272  __Pyx_GOTREF(__pyx_t_15);
5273  __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_15, __pyx_n_s_asarray); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 81, __pyx_L1_error)
5274  __Pyx_GOTREF(__pyx_t_13);
5275  __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
5276  __pyx_t_7 = __pyx_v_cmesh->mesh.edgeOffsets_subdomain_owned;
5277  __pyx_t_15 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_comm), __pyx_n_s_size); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 81, __pyx_L1_error)
5278  __Pyx_GOTREF(__pyx_t_15);
5279  __pyx_t_16 = __Pyx_PyInt_AddObjC(__pyx_t_15, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 81, __pyx_L1_error)
5280  __Pyx_GOTREF(__pyx_t_16);
5281  __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
5282  __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_16); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 81, __pyx_L1_error)
5283  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
5284  if (!__pyx_t_7) {
5285  PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
5286  __PYX_ERR(0, 81, __pyx_L1_error)
5287  }
5288  __pyx_t_15 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_int);
5289  __pyx_t_16 = Py_BuildValue((char*) "(" __PYX_BUILD_PY_SSIZE_T ")", ((Py_ssize_t)__pyx_t_9));
5290  if (unlikely(!__pyx_t_15 || !__pyx_t_16 || !PyBytes_AsString(__pyx_t_15))) __PYX_ERR(0, 81, __pyx_L1_error)
5291  __Pyx_GOTREF(__pyx_t_15);
5292  __Pyx_GOTREF(__pyx_t_16);
5293  __pyx_t_10 = __pyx_array_new(__pyx_t_16, sizeof(int), PyBytes_AS_STRING(__pyx_t_15), (char *) "c", (char *) __pyx_t_7);
5294  if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 81, __pyx_L1_error)
5295  __Pyx_GOTREF(__pyx_t_10);
5296  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
5297  __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
5298  __pyx_t_15 = NULL;
5299  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_13))) {
5300  __pyx_t_15 = PyMethod_GET_SELF(__pyx_t_13);
5301  if (likely(__pyx_t_15)) {
5302  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_13);
5303  __Pyx_INCREF(__pyx_t_15);
5304  __Pyx_INCREF(function);
5305  __Pyx_DECREF_SET(__pyx_t_13, function);
5306  }
5307  }
5308  __pyx_t_14 = (__pyx_t_15) ? __Pyx_PyObject_Call2Args(__pyx_t_13, __pyx_t_15, ((PyObject *)__pyx_t_10)) : __Pyx_PyObject_CallOneArg(__pyx_t_13, ((PyObject *)__pyx_t_10));
5309  __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
5310  __Pyx_DECREF(((PyObject *)__pyx_t_10)); __pyx_t_10 = 0;
5311  if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 81, __pyx_L1_error)
5312  __Pyx_GOTREF(__pyx_t_14);
5313  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
5314 
5315  /* "cpartitioning.pyx":82
5316  * np.asarray(<int[:cmesh.mesh.subdomainp.nElementBoundaries_global]> cmesh.mesh.elementBoundaryNumbering_subdomain2global),
5317  * np.asarray(<int[:comm.size+1]> cmesh.mesh.edgeOffsets_subdomain_owned),
5318  * np.asarray(<int[:cmesh.mesh.subdomainp.nEdges_global]> cmesh.mesh.edgeNumbering_subdomain2global) # <<<<<<<<<<<<<<
5319  * )
5320  *
5321  */
5322  __Pyx_GetModuleGlobalName(__pyx_t_15, __pyx_n_s_np); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 82, __pyx_L1_error)
5323  __Pyx_GOTREF(__pyx_t_15);
5324  __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_t_15, __pyx_n_s_asarray); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 82, __pyx_L1_error)
5325  __Pyx_GOTREF(__pyx_t_16);
5326  __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
5327  __pyx_t_7 = __pyx_v_cmesh->mesh.edgeNumbering_subdomain2global;
5328  if (!__pyx_t_7) {
5329  PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
5330  __PYX_ERR(0, 82, __pyx_L1_error)
5331  }
5332  __pyx_t_17 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_int);
5333  __pyx_t_15 = Py_BuildValue((char*) "(" __PYX_BUILD_PY_SSIZE_T ")", ((Py_ssize_t)__pyx_v_cmesh->mesh.subdomainp->nEdges_global));
5334  if (unlikely(!__pyx_t_17 || !__pyx_t_15 || !PyBytes_AsString(__pyx_t_17))) __PYX_ERR(0, 82, __pyx_L1_error)
5335  __Pyx_GOTREF(__pyx_t_17);
5336  __Pyx_GOTREF(__pyx_t_15);
5337  __pyx_t_10 = __pyx_array_new(__pyx_t_15, sizeof(int), PyBytes_AS_STRING(__pyx_t_17), (char *) "c", (char *) __pyx_t_7);
5338  if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 82, __pyx_L1_error)
5339  __Pyx_GOTREF(__pyx_t_10);
5340  __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
5341  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
5342  __pyx_t_17 = NULL;
5343  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_16))) {
5344  __pyx_t_17 = PyMethod_GET_SELF(__pyx_t_16);
5345  if (likely(__pyx_t_17)) {
5346  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_16);
5347  __Pyx_INCREF(__pyx_t_17);
5348  __Pyx_INCREF(function);
5349  __Pyx_DECREF_SET(__pyx_t_16, function);
5350  }
5351  }
5352  __pyx_t_13 = (__pyx_t_17) ? __Pyx_PyObject_Call2Args(__pyx_t_16, __pyx_t_17, ((PyObject *)__pyx_t_10)) : __Pyx_PyObject_CallOneArg(__pyx_t_16, ((PyObject *)__pyx_t_10));
5353  __Pyx_XDECREF(__pyx_t_17); __pyx_t_17 = 0;
5354  __Pyx_DECREF(((PyObject *)__pyx_t_10)); __pyx_t_10 = 0;
5355  if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 82, __pyx_L1_error)
5356  __Pyx_GOTREF(__pyx_t_13);
5357  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
5358 
5359  /* "cpartitioning.pyx":75
5360  * nLayersOfOverlap)
5361  * return (
5362  * np.asarray(<int[:comm.size+1]> cmesh.mesh.elementOffsets_subdomain_owned), # <<<<<<<<<<<<<<
5363  * np.asarray(<int[:cmesh.mesh.subdomainp.nElements_global]> cmesh.mesh.elementNumbering_subdomain2global),
5364  * np.asarray(<int[:comm.size+1]> cmesh.mesh.nodeOffsets_subdomain_owned),
5365  */
5366  __pyx_t_16 = PyTuple_New(8); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 75, __pyx_L1_error)
5367  __Pyx_GOTREF(__pyx_t_16);
5368  __Pyx_GIVEREF(__pyx_t_3);
5369  PyTuple_SET_ITEM(__pyx_t_16, 0, __pyx_t_3);
5370  __Pyx_GIVEREF(__pyx_t_5);
5371  PyTuple_SET_ITEM(__pyx_t_16, 1, __pyx_t_5);
5372  __Pyx_GIVEREF(__pyx_t_8);
5373  PyTuple_SET_ITEM(__pyx_t_16, 2, __pyx_t_8);
5374  __Pyx_GIVEREF(__pyx_t_4);
5375  PyTuple_SET_ITEM(__pyx_t_16, 3, __pyx_t_4);
5376  __Pyx_GIVEREF(__pyx_t_12);
5377  PyTuple_SET_ITEM(__pyx_t_16, 4, __pyx_t_12);
5378  __Pyx_GIVEREF(__pyx_t_11);
5379  PyTuple_SET_ITEM(__pyx_t_16, 5, __pyx_t_11);
5380  __Pyx_GIVEREF(__pyx_t_14);
5381  PyTuple_SET_ITEM(__pyx_t_16, 6, __pyx_t_14);
5382  __Pyx_GIVEREF(__pyx_t_13);
5383  PyTuple_SET_ITEM(__pyx_t_16, 7, __pyx_t_13);
5384  __pyx_t_3 = 0;
5385  __pyx_t_5 = 0;
5386  __pyx_t_8 = 0;
5387  __pyx_t_4 = 0;
5388  __pyx_t_12 = 0;
5389  __pyx_t_11 = 0;
5390  __pyx_t_14 = 0;
5391  __pyx_t_13 = 0;
5392  __pyx_r = __pyx_t_16;
5393  __pyx_t_16 = 0;
5394  goto __pyx_L0;
5395 
5396  /* "cpartitioning.pyx":65
5397  * )
5398  *
5399  * def partitionNodesFromTetgenFiles(Comm comm, object filebase, int indexBase, int nLayersOfOverlap, cmeshTools.CMesh cmesh, cmeshTools.CMesh subdomain_cmesh): # <<<<<<<<<<<<<<
5400  * cmesh.mesh.subdomainp = &subdomain_cmesh.mesh
5401  * if not isinstance(filebase, bytes):
5402  */
5403 
5404  /* function exit code */
5405  __pyx_L1_error:;
5406  __Pyx_XDECREF(__pyx_t_3);
5407  __Pyx_XDECREF(__pyx_t_4);
5408  __Pyx_XDECREF(__pyx_t_5);
5409  __Pyx_XDECREF(__pyx_t_8);
5410  __Pyx_XDECREF(((PyObject *)__pyx_t_10));
5411  __Pyx_XDECREF(__pyx_t_11);
5412  __Pyx_XDECREF(__pyx_t_12);
5413  __Pyx_XDECREF(__pyx_t_13);
5414  __Pyx_XDECREF(__pyx_t_14);
5415  __Pyx_XDECREF(__pyx_t_15);
5416  __Pyx_XDECREF(__pyx_t_16);
5417  __Pyx_XDECREF(__pyx_t_17);
5418  __Pyx_AddTraceback("cpartitioning.partitionNodesFromTetgenFiles", __pyx_clineno, __pyx_lineno, __pyx_filename);
5419  __pyx_r = NULL;
5420  __pyx_L0:;
5421  __Pyx_XDECREF(__pyx_v_filebase);
5422  __Pyx_XGIVEREF(__pyx_r);
5423  __Pyx_RefNannyFinishContext();
5424  return __pyx_r;
5425 }
5426 
5427 /* "cpartitioning.pyx":85
5428  * )
5429  *
5430  * def buildQuadraticLocal2GlobalMappings(Comm comm, # <<<<<<<<<<<<<<
5431  * int nSpace,
5432  * cmeshTools.CMesh cmesh,
5433  */
5434 
5435 /* Python wrapper */
5436 static PyObject *__pyx_pw_13cpartitioning_9buildQuadraticLocal2GlobalMappings(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
5437 static PyMethodDef __pyx_mdef_13cpartitioning_9buildQuadraticLocal2GlobalMappings = {"buildQuadraticLocal2GlobalMappings", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_13cpartitioning_9buildQuadraticLocal2GlobalMappings, METH_VARARGS|METH_KEYWORDS, 0};
5438 static PyObject *__pyx_pw_13cpartitioning_9buildQuadraticLocal2GlobalMappings(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
5439  struct PyMPICommObject *__pyx_v_comm = 0;
5440  int __pyx_v_nSpace;
5441  struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_cmesh = 0;
5442  CYTHON_UNUSED struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_subdomain_cmesh = 0;
5443  PyArrayObject *__pyx_v_elementOffsets_subdomain_owned = 0;
5444  PyArrayObject *__pyx_v_nodeOffsets_subdomain_owned = 0;
5445  PyArrayObject *__pyx_v_elementBoundaryOffsets_subdomain_owned = 0;
5446  PyArrayObject *__pyx_v_edgeOffsets_subdomain_owned = 0;
5447  PyArrayObject *__pyx_v_elementNumbering_subdomain2global = 0;
5448  PyArrayObject *__pyx_v_nodeNumbering_subdomain2global = 0;
5449  PyArrayObject *__pyx_v_elementBoundaryNumbering_subdomain2global = 0;
5450  PyArrayObject *__pyx_v_edgeNumbering_subdomain2global = 0;
5451  PyArrayObject *__pyx_v_quadratic_dof_offsets_subdomain_owned = 0;
5452  PyArrayObject *__pyx_v_quadratic_subdomain_l2g = 0;
5453  PyArrayObject *__pyx_v_quadraticNumbering_subdomain2global = 0;
5454  PyArrayObject *__pyx_v_quadratic_lagrangeNodes = 0;
5455  PyObject *__pyx_r = 0;
5456  __Pyx_RefNannyDeclarations
5457  __Pyx_RefNannySetupContext("buildQuadraticLocal2GlobalMappings (wrapper)", 0);
5458  {
5459  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_comm,&__pyx_n_s_nSpace,&__pyx_n_s_cmesh,&__pyx_n_s_subdomain_cmesh,&__pyx_n_s_elementOffsets_subdomain_owned,&__pyx_n_s_nodeOffsets_subdomain_owned,&__pyx_n_s_elementBoundaryOffsets_subdomain,&__pyx_n_s_edgeOffsets_subdomain_owned,&__pyx_n_s_elementNumbering_subdomain2globa,&__pyx_n_s_nodeNumbering_subdomain2global,&__pyx_n_s_elementBoundaryNumbering_subdoma,&__pyx_n_s_edgeNumbering_subdomain2global,&__pyx_n_s_quadratic_dof_offsets_subdomain,&__pyx_n_s_quadratic_subdomain_l2g,&__pyx_n_s_quadraticNumbering_subdomain2glo,&__pyx_n_s_quadratic_lagrangeNodes,0};
5460  PyObject* values[16] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
5461  if (unlikely(__pyx_kwds)) {
5462  Py_ssize_t kw_args;
5463  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
5464  switch (pos_args) {
5465  case 16: values[15] = PyTuple_GET_ITEM(__pyx_args, 15);
5466  CYTHON_FALLTHROUGH;
5467  case 15: values[14] = PyTuple_GET_ITEM(__pyx_args, 14);
5468  CYTHON_FALLTHROUGH;
5469  case 14: values[13] = PyTuple_GET_ITEM(__pyx_args, 13);
5470  CYTHON_FALLTHROUGH;
5471  case 13: values[12] = PyTuple_GET_ITEM(__pyx_args, 12);
5472  CYTHON_FALLTHROUGH;
5473  case 12: values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
5474  CYTHON_FALLTHROUGH;
5475  case 11: values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
5476  CYTHON_FALLTHROUGH;
5477  case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
5478  CYTHON_FALLTHROUGH;
5479  case 9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
5480  CYTHON_FALLTHROUGH;
5481  case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
5482  CYTHON_FALLTHROUGH;
5483  case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
5484  CYTHON_FALLTHROUGH;
5485  case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
5486  CYTHON_FALLTHROUGH;
5487  case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
5488  CYTHON_FALLTHROUGH;
5489  case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
5490  CYTHON_FALLTHROUGH;
5491  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
5492  CYTHON_FALLTHROUGH;
5493  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5494  CYTHON_FALLTHROUGH;
5495  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5496  CYTHON_FALLTHROUGH;
5497  case 0: break;
5498  default: goto __pyx_L5_argtuple_error;
5499  }
5500  kw_args = PyDict_Size(__pyx_kwds);
5501  switch (pos_args) {
5502  case 0:
5503  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_comm)) != 0)) kw_args--;
5504  else goto __pyx_L5_argtuple_error;
5505  CYTHON_FALLTHROUGH;
5506  case 1:
5507  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nSpace)) != 0)) kw_args--;
5508  else {
5509  __Pyx_RaiseArgtupleInvalid("buildQuadraticLocal2GlobalMappings", 1, 16, 16, 1); __PYX_ERR(0, 85, __pyx_L3_error)
5510  }
5511  CYTHON_FALLTHROUGH;
5512  case 2:
5513  if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_cmesh)) != 0)) kw_args--;
5514  else {
5515  __Pyx_RaiseArgtupleInvalid("buildQuadraticLocal2GlobalMappings", 1, 16, 16, 2); __PYX_ERR(0, 85, __pyx_L3_error)
5516  }
5517  CYTHON_FALLTHROUGH;
5518  case 3:
5519  if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_subdomain_cmesh)) != 0)) kw_args--;
5520  else {
5521  __Pyx_RaiseArgtupleInvalid("buildQuadraticLocal2GlobalMappings", 1, 16, 16, 3); __PYX_ERR(0, 85, __pyx_L3_error)
5522  }
5523  CYTHON_FALLTHROUGH;
5524  case 4:
5525  if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementOffsets_subdomain_owned)) != 0)) kw_args--;
5526  else {
5527  __Pyx_RaiseArgtupleInvalid("buildQuadraticLocal2GlobalMappings", 1, 16, 16, 4); __PYX_ERR(0, 85, __pyx_L3_error)
5528  }
5529  CYTHON_FALLTHROUGH;
5530  case 5:
5531  if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nodeOffsets_subdomain_owned)) != 0)) kw_args--;
5532  else {
5533  __Pyx_RaiseArgtupleInvalid("buildQuadraticLocal2GlobalMappings", 1, 16, 16, 5); __PYX_ERR(0, 85, __pyx_L3_error)
5534  }
5535  CYTHON_FALLTHROUGH;
5536  case 6:
5537  if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementBoundaryOffsets_subdomain)) != 0)) kw_args--;
5538  else {
5539  __Pyx_RaiseArgtupleInvalid("buildQuadraticLocal2GlobalMappings", 1, 16, 16, 6); __PYX_ERR(0, 85, __pyx_L3_error)
5540  }
5541  CYTHON_FALLTHROUGH;
5542  case 7:
5543  if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_edgeOffsets_subdomain_owned)) != 0)) kw_args--;
5544  else {
5545  __Pyx_RaiseArgtupleInvalid("buildQuadraticLocal2GlobalMappings", 1, 16, 16, 7); __PYX_ERR(0, 85, __pyx_L3_error)
5546  }
5547  CYTHON_FALLTHROUGH;
5548  case 8:
5549  if (likely((values[8] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementNumbering_subdomain2globa)) != 0)) kw_args--;
5550  else {
5551  __Pyx_RaiseArgtupleInvalid("buildQuadraticLocal2GlobalMappings", 1, 16, 16, 8); __PYX_ERR(0, 85, __pyx_L3_error)
5552  }
5553  CYTHON_FALLTHROUGH;
5554  case 9:
5555  if (likely((values[9] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nodeNumbering_subdomain2global)) != 0)) kw_args--;
5556  else {
5557  __Pyx_RaiseArgtupleInvalid("buildQuadraticLocal2GlobalMappings", 1, 16, 16, 9); __PYX_ERR(0, 85, __pyx_L3_error)
5558  }
5559  CYTHON_FALLTHROUGH;
5560  case 10:
5561  if (likely((values[10] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementBoundaryNumbering_subdoma)) != 0)) kw_args--;
5562  else {
5563  __Pyx_RaiseArgtupleInvalid("buildQuadraticLocal2GlobalMappings", 1, 16, 16, 10); __PYX_ERR(0, 85, __pyx_L3_error)
5564  }
5565  CYTHON_FALLTHROUGH;
5566  case 11:
5567  if (likely((values[11] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_edgeNumbering_subdomain2global)) != 0)) kw_args--;
5568  else {
5569  __Pyx_RaiseArgtupleInvalid("buildQuadraticLocal2GlobalMappings", 1, 16, 16, 11); __PYX_ERR(0, 85, __pyx_L3_error)
5570  }
5571  CYTHON_FALLTHROUGH;
5572  case 12:
5573  if (likely((values[12] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_quadratic_dof_offsets_subdomain)) != 0)) kw_args--;
5574  else {
5575  __Pyx_RaiseArgtupleInvalid("buildQuadraticLocal2GlobalMappings", 1, 16, 16, 12); __PYX_ERR(0, 85, __pyx_L3_error)
5576  }
5577  CYTHON_FALLTHROUGH;
5578  case 13:
5579  if (likely((values[13] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_quadratic_subdomain_l2g)) != 0)) kw_args--;
5580  else {
5581  __Pyx_RaiseArgtupleInvalid("buildQuadraticLocal2GlobalMappings", 1, 16, 16, 13); __PYX_ERR(0, 85, __pyx_L3_error)
5582  }
5583  CYTHON_FALLTHROUGH;
5584  case 14:
5585  if (likely((values[14] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_quadraticNumbering_subdomain2glo)) != 0)) kw_args--;
5586  else {
5587  __Pyx_RaiseArgtupleInvalid("buildQuadraticLocal2GlobalMappings", 1, 16, 16, 14); __PYX_ERR(0, 85, __pyx_L3_error)
5588  }
5589  CYTHON_FALLTHROUGH;
5590  case 15:
5591  if (likely((values[15] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_quadratic_lagrangeNodes)) != 0)) kw_args--;
5592  else {
5593  __Pyx_RaiseArgtupleInvalid("buildQuadraticLocal2GlobalMappings", 1, 16, 16, 15); __PYX_ERR(0, 85, __pyx_L3_error)
5594  }
5595  }
5596  if (unlikely(kw_args > 0)) {
5597  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "buildQuadraticLocal2GlobalMappings") < 0)) __PYX_ERR(0, 85, __pyx_L3_error)
5598  }
5599  } else if (PyTuple_GET_SIZE(__pyx_args) != 16) {
5600  goto __pyx_L5_argtuple_error;
5601  } else {
5602  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5603  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5604  values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
5605  values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
5606  values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
5607  values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
5608  values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
5609  values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
5610  values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
5611  values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
5612  values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
5613  values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
5614  values[12] = PyTuple_GET_ITEM(__pyx_args, 12);
5615  values[13] = PyTuple_GET_ITEM(__pyx_args, 13);
5616  values[14] = PyTuple_GET_ITEM(__pyx_args, 14);
5617  values[15] = PyTuple_GET_ITEM(__pyx_args, 15);
5618  }
5619  __pyx_v_comm = ((struct PyMPICommObject *)values[0]);
5620  __pyx_v_nSpace = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_nSpace == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 86, __pyx_L3_error)
5621  __pyx_v_cmesh = ((struct __pyx_obj_7proteus_10cmeshTools_CMesh *)values[2]);
5622  __pyx_v_subdomain_cmesh = ((struct __pyx_obj_7proteus_10cmeshTools_CMesh *)values[3]);
5623  __pyx_v_elementOffsets_subdomain_owned = ((PyArrayObject *)values[4]);
5624  __pyx_v_nodeOffsets_subdomain_owned = ((PyArrayObject *)values[5]);
5625  __pyx_v_elementBoundaryOffsets_subdomain_owned = ((PyArrayObject *)values[6]);
5626  __pyx_v_edgeOffsets_subdomain_owned = ((PyArrayObject *)values[7]);
5627  __pyx_v_elementNumbering_subdomain2global = ((PyArrayObject *)values[8]);
5628  __pyx_v_nodeNumbering_subdomain2global = ((PyArrayObject *)values[9]);
5629  __pyx_v_elementBoundaryNumbering_subdomain2global = ((PyArrayObject *)values[10]);
5630  __pyx_v_edgeNumbering_subdomain2global = ((PyArrayObject *)values[11]);
5631  __pyx_v_quadratic_dof_offsets_subdomain_owned = ((PyArrayObject *)values[12]);
5632  __pyx_v_quadratic_subdomain_l2g = ((PyArrayObject *)values[13]);
5633  __pyx_v_quadraticNumbering_subdomain2global = ((PyArrayObject *)values[14]);
5634  __pyx_v_quadratic_lagrangeNodes = ((PyArrayObject *)values[15]);
5635  }
5636  goto __pyx_L4_argument_unpacking_done;
5637  __pyx_L5_argtuple_error:;
5638  __Pyx_RaiseArgtupleInvalid("buildQuadraticLocal2GlobalMappings", 1, 16, 16, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 85, __pyx_L3_error)
5639  __pyx_L3_error:;
5640  __Pyx_AddTraceback("cpartitioning.buildQuadraticLocal2GlobalMappings", __pyx_clineno, __pyx_lineno, __pyx_filename);
5641  __Pyx_RefNannyFinishContext();
5642  return NULL;
5643  __pyx_L4_argument_unpacking_done:;
5644  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_comm), __pyx_ptype_6mpi4py_3MPI_Comm, 1, "comm", 0))) __PYX_ERR(0, 85, __pyx_L1_error)
5645  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_cmesh), __pyx_ptype_7proteus_10cmeshTools_CMesh, 1, "cmesh", 0))) __PYX_ERR(0, 87, __pyx_L1_error)
5646  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_subdomain_cmesh), __pyx_ptype_7proteus_10cmeshTools_CMesh, 1, "subdomain_cmesh", 0))) __PYX_ERR(0, 88, __pyx_L1_error)
5647  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementOffsets_subdomain_owned), __pyx_ptype_5numpy_ndarray, 1, "elementOffsets_subdomain_owned", 0))) __PYX_ERR(0, 89, __pyx_L1_error)
5648  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_nodeOffsets_subdomain_owned), __pyx_ptype_5numpy_ndarray, 1, "nodeOffsets_subdomain_owned", 0))) __PYX_ERR(0, 90, __pyx_L1_error)
5649  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementBoundaryOffsets_subdomain_owned), __pyx_ptype_5numpy_ndarray, 1, "elementBoundaryOffsets_subdomain_owned", 0))) __PYX_ERR(0, 91, __pyx_L1_error)
5650  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_edgeOffsets_subdomain_owned), __pyx_ptype_5numpy_ndarray, 1, "edgeOffsets_subdomain_owned", 0))) __PYX_ERR(0, 92, __pyx_L1_error)
5651  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementNumbering_subdomain2global), __pyx_ptype_5numpy_ndarray, 1, "elementNumbering_subdomain2global", 0))) __PYX_ERR(0, 93, __pyx_L1_error)
5652  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_nodeNumbering_subdomain2global), __pyx_ptype_5numpy_ndarray, 1, "nodeNumbering_subdomain2global", 0))) __PYX_ERR(0, 94, __pyx_L1_error)
5653  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementBoundaryNumbering_subdomain2global), __pyx_ptype_5numpy_ndarray, 1, "elementBoundaryNumbering_subdomain2global", 0))) __PYX_ERR(0, 95, __pyx_L1_error)
5654  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_edgeNumbering_subdomain2global), __pyx_ptype_5numpy_ndarray, 1, "edgeNumbering_subdomain2global", 0))) __PYX_ERR(0, 96, __pyx_L1_error)
5655  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_quadratic_dof_offsets_subdomain_owned), __pyx_ptype_5numpy_ndarray, 1, "quadratic_dof_offsets_subdomain_owned", 0))) __PYX_ERR(0, 97, __pyx_L1_error)
5656  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_quadratic_subdomain_l2g), __pyx_ptype_5numpy_ndarray, 1, "quadratic_subdomain_l2g", 0))) __PYX_ERR(0, 98, __pyx_L1_error)
5657  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_quadraticNumbering_subdomain2global), __pyx_ptype_5numpy_ndarray, 1, "quadraticNumbering_subdomain2global", 0))) __PYX_ERR(0, 99, __pyx_L1_error)
5658  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_quadratic_lagrangeNodes), __pyx_ptype_5numpy_ndarray, 1, "quadratic_lagrangeNodes", 0))) __PYX_ERR(0, 100, __pyx_L1_error)
5659  __pyx_r = __pyx_pf_13cpartitioning_8buildQuadraticLocal2GlobalMappings(__pyx_self, __pyx_v_comm, __pyx_v_nSpace, __pyx_v_cmesh, __pyx_v_subdomain_cmesh, __pyx_v_elementOffsets_subdomain_owned, __pyx_v_nodeOffsets_subdomain_owned, __pyx_v_elementBoundaryOffsets_subdomain_owned, __pyx_v_edgeOffsets_subdomain_owned, __pyx_v_elementNumbering_subdomain2global, __pyx_v_nodeNumbering_subdomain2global, __pyx_v_elementBoundaryNumbering_subdomain2global, __pyx_v_edgeNumbering_subdomain2global, __pyx_v_quadratic_dof_offsets_subdomain_owned, __pyx_v_quadratic_subdomain_l2g, __pyx_v_quadraticNumbering_subdomain2global, __pyx_v_quadratic_lagrangeNodes);
5660 
5661  /* function exit code */
5662  goto __pyx_L0;
5663  __pyx_L1_error:;
5664  __pyx_r = NULL;
5665  __pyx_L0:;
5666  __Pyx_RefNannyFinishContext();
5667  return __pyx_r;
5668 }
5669 
5670 static PyObject *__pyx_pf_13cpartitioning_8buildQuadraticLocal2GlobalMappings(CYTHON_UNUSED PyObject *__pyx_self, struct PyMPICommObject *__pyx_v_comm, int __pyx_v_nSpace, struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_cmesh, CYTHON_UNUSED struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_subdomain_cmesh, PyArrayObject *__pyx_v_elementOffsets_subdomain_owned, PyArrayObject *__pyx_v_nodeOffsets_subdomain_owned, PyArrayObject *__pyx_v_elementBoundaryOffsets_subdomain_owned, PyArrayObject *__pyx_v_edgeOffsets_subdomain_owned, PyArrayObject *__pyx_v_elementNumbering_subdomain2global, PyArrayObject *__pyx_v_nodeNumbering_subdomain2global, PyArrayObject *__pyx_v_elementBoundaryNumbering_subdomain2global, PyArrayObject *__pyx_v_edgeNumbering_subdomain2global, PyArrayObject *__pyx_v_quadratic_dof_offsets_subdomain_owned, PyArrayObject *__pyx_v_quadratic_subdomain_l2g, PyArrayObject *__pyx_v_quadraticNumbering_subdomain2global, PyArrayObject *__pyx_v_quadratic_lagrangeNodes) {
5671  int __pyx_v_nDOF_all_processes;
5672  int __pyx_v_nDOF_subdomain;
5673  int __pyx_v_max_dof_neighbors;
5674  PyObject *__pyx_r = NULL;
5675  __Pyx_RefNannyDeclarations
5676  PyObject *__pyx_t_1 = NULL;
5677  PyObject *__pyx_t_2 = NULL;
5678  PyObject *__pyx_t_3 = NULL;
5679  PyObject *__pyx_t_4 = NULL;
5680  __Pyx_RefNannySetupContext("buildQuadraticLocal2GlobalMappings", 0);
5681 
5682  /* "cpartitioning.pyx":101
5683  * np.ndarray quadraticNumbering_subdomain2global,
5684  * np.ndarray quadratic_lagrangeNodes):
5685  * cdef int nDOF_all_processes=0 # <<<<<<<<<<<<<<
5686  * cdef int nDOF_subdomain=0
5687  * cdef int max_dof_neighbors=0
5688  */
5689  __pyx_v_nDOF_all_processes = 0;
5690 
5691  /* "cpartitioning.pyx":102
5692  * np.ndarray quadratic_lagrangeNodes):
5693  * cdef int nDOF_all_processes=0
5694  * cdef int nDOF_subdomain=0 # <<<<<<<<<<<<<<
5695  * cdef int max_dof_neighbors=0
5696  * if nSpace == 1:
5697  */
5698  __pyx_v_nDOF_subdomain = 0;
5699 
5700  /* "cpartitioning.pyx":103
5701  * cdef int nDOF_all_processes=0
5702  * cdef int nDOF_subdomain=0
5703  * cdef int max_dof_neighbors=0 # <<<<<<<<<<<<<<
5704  * if nSpace == 1:
5705  * buildQuadraticSubdomain2GlobalMappings_1d(comm.ob_mpi,
5706  */
5707  __pyx_v_max_dof_neighbors = 0;
5708 
5709  /* "cpartitioning.pyx":104
5710  * cdef int nDOF_subdomain=0
5711  * cdef int max_dof_neighbors=0
5712  * if nSpace == 1: # <<<<<<<<<<<<<<
5713  * buildQuadraticSubdomain2GlobalMappings_1d(comm.ob_mpi,
5714  * cmesh.mesh,
5715  */
5716  switch (__pyx_v_nSpace) {
5717  case 1:
5718 
5719  /* "cpartitioning.pyx":105
5720  * cdef int max_dof_neighbors=0
5721  * if nSpace == 1:
5722  * buildQuadraticSubdomain2GlobalMappings_1d(comm.ob_mpi, # <<<<<<<<<<<<<<
5723  * cmesh.mesh,
5724  * <int*>(elementOffsets_subdomain_owned.data),
5725  */
5726  (void)(proteus::buildQuadraticSubdomain2GlobalMappings_1d(__pyx_v_comm->ob_mpi, __pyx_v_cmesh->mesh, ((int *)__pyx_v_elementOffsets_subdomain_owned->data), ((int *)__pyx_v_nodeOffsets_subdomain_owned->data), ((int *)__pyx_v_elementNumbering_subdomain2global->data), ((int *)__pyx_v_nodeNumbering_subdomain2global->data), __pyx_v_nDOF_all_processes, __pyx_v_nDOF_subdomain, __pyx_v_max_dof_neighbors, ((int *)__pyx_v_quadratic_dof_offsets_subdomain_owned->data), ((int *)__pyx_v_quadratic_subdomain_l2g->data), ((int *)__pyx_v_quadraticNumbering_subdomain2global->data), ((double *)__pyx_v_quadratic_lagrangeNodes->data)));
5727 
5728  /* "cpartitioning.pyx":104
5729  * cdef int nDOF_subdomain=0
5730  * cdef int max_dof_neighbors=0
5731  * if nSpace == 1: # <<<<<<<<<<<<<<
5732  * buildQuadraticSubdomain2GlobalMappings_1d(comm.ob_mpi,
5733  * cmesh.mesh,
5734  */
5735  break;
5736  case 2:
5737 
5738  /* "cpartitioning.pyx":119
5739  * <double*>(quadratic_lagrangeNodes.data));
5740  * elif nSpace == 2:
5741  * buildQuadraticSubdomain2GlobalMappings_2d(comm.ob_mpi, # <<<<<<<<<<<<<<
5742  * cmesh.mesh,
5743  * <int*>(elementBoundaryOffsets_subdomain_owned.data),
5744  */
5745  (void)(proteus::buildQuadraticSubdomain2GlobalMappings_2d(__pyx_v_comm->ob_mpi, __pyx_v_cmesh->mesh, ((int *)__pyx_v_elementBoundaryOffsets_subdomain_owned->data), ((int *)__pyx_v_nodeOffsets_subdomain_owned->data), ((int *)__pyx_v_elementBoundaryNumbering_subdomain2global->data), ((int *)__pyx_v_nodeNumbering_subdomain2global->data), __pyx_v_nDOF_all_processes, __pyx_v_nDOF_subdomain, __pyx_v_max_dof_neighbors, ((int *)__pyx_v_quadratic_dof_offsets_subdomain_owned->data), ((int *)__pyx_v_quadratic_subdomain_l2g->data), ((int *)__pyx_v_quadraticNumbering_subdomain2global->data), ((double *)__pyx_v_quadratic_lagrangeNodes->data)));
5746 
5747  /* "cpartitioning.pyx":118
5748  * <int*>(quadraticNumbering_subdomain2global.data),
5749  * <double*>(quadratic_lagrangeNodes.data));
5750  * elif nSpace == 2: # <<<<<<<<<<<<<<
5751  * buildQuadraticSubdomain2GlobalMappings_2d(comm.ob_mpi,
5752  * cmesh.mesh,
5753  */
5754  break;
5755  default:
5756 
5757  /* "cpartitioning.pyx":133
5758  * <double*>(quadratic_lagrangeNodes.data))
5759  * else:
5760  * buildQuadraticSubdomain2GlobalMappings_3d(comm.ob_mpi, # <<<<<<<<<<<<<<
5761  * cmesh.mesh,
5762  * <int*>(edgeOffsets_subdomain_owned.data),
5763  */
5764  (void)(proteus::buildQuadraticSubdomain2GlobalMappings_3d(__pyx_v_comm->ob_mpi, __pyx_v_cmesh->mesh, ((int *)__pyx_v_edgeOffsets_subdomain_owned->data), ((int *)__pyx_v_nodeOffsets_subdomain_owned->data), ((int *)__pyx_v_edgeNumbering_subdomain2global->data), ((int *)__pyx_v_nodeNumbering_subdomain2global->data), __pyx_v_nDOF_all_processes, __pyx_v_nDOF_subdomain, __pyx_v_max_dof_neighbors, ((int *)__pyx_v_quadratic_dof_offsets_subdomain_owned->data), ((int *)__pyx_v_quadratic_subdomain_l2g->data), ((int *)__pyx_v_quadraticNumbering_subdomain2global->data), ((double *)__pyx_v_quadratic_lagrangeNodes->data)));
5765  break;
5766  }
5767 
5768  /* "cpartitioning.pyx":146
5769  * <int*>(quadraticNumbering_subdomain2global.data),
5770  * <double*>(quadratic_lagrangeNodes.data))
5771  * return (nDOF_all_processes, # <<<<<<<<<<<<<<
5772  * nDOF_subdomain,
5773  * max_dof_neighbors)
5774  */
5775  __Pyx_XDECREF(__pyx_r);
5776  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_nDOF_all_processes); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 146, __pyx_L1_error)
5777  __Pyx_GOTREF(__pyx_t_1);
5778 
5779  /* "cpartitioning.pyx":147
5780  * <double*>(quadratic_lagrangeNodes.data))
5781  * return (nDOF_all_processes,
5782  * nDOF_subdomain, # <<<<<<<<<<<<<<
5783  * max_dof_neighbors)
5784  *
5785  */
5786  __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_nDOF_subdomain); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 147, __pyx_L1_error)
5787  __Pyx_GOTREF(__pyx_t_2);
5788 
5789  /* "cpartitioning.pyx":148
5790  * return (nDOF_all_processes,
5791  * nDOF_subdomain,
5792  * max_dof_neighbors) # <<<<<<<<<<<<<<
5793  *
5794  * def buildQuadraticCubeLocal2GlobalMappings(Comm comm,
5795  */
5796  __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_max_dof_neighbors); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 148, __pyx_L1_error)
5797  __Pyx_GOTREF(__pyx_t_3);
5798 
5799  /* "cpartitioning.pyx":146
5800  * <int*>(quadraticNumbering_subdomain2global.data),
5801  * <double*>(quadratic_lagrangeNodes.data))
5802  * return (nDOF_all_processes, # <<<<<<<<<<<<<<
5803  * nDOF_subdomain,
5804  * max_dof_neighbors)
5805  */
5806  __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 146, __pyx_L1_error)
5807  __Pyx_GOTREF(__pyx_t_4);
5808  __Pyx_GIVEREF(__pyx_t_1);
5809  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
5810  __Pyx_GIVEREF(__pyx_t_2);
5811  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2);
5812  __Pyx_GIVEREF(__pyx_t_3);
5813  PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_3);
5814  __pyx_t_1 = 0;
5815  __pyx_t_2 = 0;
5816  __pyx_t_3 = 0;
5817  __pyx_r = __pyx_t_4;
5818  __pyx_t_4 = 0;
5819  goto __pyx_L0;
5820 
5821  /* "cpartitioning.pyx":85
5822  * )
5823  *
5824  * def buildQuadraticLocal2GlobalMappings(Comm comm, # <<<<<<<<<<<<<<
5825  * int nSpace,
5826  * cmeshTools.CMesh cmesh,
5827  */
5828 
5829  /* function exit code */
5830  __pyx_L1_error:;
5831  __Pyx_XDECREF(__pyx_t_1);
5832  __Pyx_XDECREF(__pyx_t_2);
5833  __Pyx_XDECREF(__pyx_t_3);
5834  __Pyx_XDECREF(__pyx_t_4);
5835  __Pyx_AddTraceback("cpartitioning.buildQuadraticLocal2GlobalMappings", __pyx_clineno, __pyx_lineno, __pyx_filename);
5836  __pyx_r = NULL;
5837  __pyx_L0:;
5838  __Pyx_XGIVEREF(__pyx_r);
5839  __Pyx_RefNannyFinishContext();
5840  return __pyx_r;
5841 }
5842 
5843 /* "cpartitioning.pyx":150
5844  * max_dof_neighbors)
5845  *
5846  * def buildQuadraticCubeLocal2GlobalMappings(Comm comm, # <<<<<<<<<<<<<<
5847  * int nSpace,
5848  * cmeshTools.CMesh cmesh,
5849  */
5850 
5851 /* Python wrapper */
5852 static PyObject *__pyx_pw_13cpartitioning_11buildQuadraticCubeLocal2GlobalMappings(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
5853 static PyMethodDef __pyx_mdef_13cpartitioning_11buildQuadraticCubeLocal2GlobalMappings = {"buildQuadraticCubeLocal2GlobalMappings", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_13cpartitioning_11buildQuadraticCubeLocal2GlobalMappings, METH_VARARGS|METH_KEYWORDS, 0};
5854 static PyObject *__pyx_pw_13cpartitioning_11buildQuadraticCubeLocal2GlobalMappings(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
5855  struct PyMPICommObject *__pyx_v_comm = 0;
5856  int __pyx_v_nSpace;
5857  struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_cmesh = 0;
5858  CYTHON_UNUSED struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_subdomain_cmesh = 0;
5859  CYTHON_UNUSED PyArrayObject *__pyx_v_elementOffsets_subdomain_owned = 0;
5860  PyArrayObject *__pyx_v_nodeOffsets_subdomain_owned = 0;
5861  CYTHON_UNUSED PyArrayObject *__pyx_v_elementBoundaryOffsets_subdomain_owned = 0;
5862  PyArrayObject *__pyx_v_edgeOffsets_subdomain_owned = 0;
5863  CYTHON_UNUSED PyArrayObject *__pyx_v_elementNumbering_subdomain2global = 0;
5864  PyArrayObject *__pyx_v_nodeNumbering_subdomain2global = 0;
5865  CYTHON_UNUSED PyArrayObject *__pyx_v_elementBoundaryNumbering_subdomain2global = 0;
5866  PyArrayObject *__pyx_v_edgeNumbering_subdomain2global = 0;
5867  PyArrayObject *__pyx_v_quadratic_dof_offsets_subdomain_owned = 0;
5868  PyArrayObject *__pyx_v_quadratic_subdomain_l2g = 0;
5869  PyArrayObject *__pyx_v_quadraticNumbering_subdomain2global = 0;
5870  PyArrayObject *__pyx_v_quadratic_lagrangeNodes = 0;
5871  PyObject *__pyx_r = 0;
5872  __Pyx_RefNannyDeclarations
5873  __Pyx_RefNannySetupContext("buildQuadraticCubeLocal2GlobalMappings (wrapper)", 0);
5874  {
5875  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_comm,&__pyx_n_s_nSpace,&__pyx_n_s_cmesh,&__pyx_n_s_subdomain_cmesh,&__pyx_n_s_elementOffsets_subdomain_owned,&__pyx_n_s_nodeOffsets_subdomain_owned,&__pyx_n_s_elementBoundaryOffsets_subdomain,&__pyx_n_s_edgeOffsets_subdomain_owned,&__pyx_n_s_elementNumbering_subdomain2globa,&__pyx_n_s_nodeNumbering_subdomain2global,&__pyx_n_s_elementBoundaryNumbering_subdoma,&__pyx_n_s_edgeNumbering_subdomain2global,&__pyx_n_s_quadratic_dof_offsets_subdomain,&__pyx_n_s_quadratic_subdomain_l2g,&__pyx_n_s_quadraticNumbering_subdomain2glo,&__pyx_n_s_quadratic_lagrangeNodes,0};
5876  PyObject* values[16] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
5877  if (unlikely(__pyx_kwds)) {
5878  Py_ssize_t kw_args;
5879  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
5880  switch (pos_args) {
5881  case 16: values[15] = PyTuple_GET_ITEM(__pyx_args, 15);
5882  CYTHON_FALLTHROUGH;
5883  case 15: values[14] = PyTuple_GET_ITEM(__pyx_args, 14);
5884  CYTHON_FALLTHROUGH;
5885  case 14: values[13] = PyTuple_GET_ITEM(__pyx_args, 13);
5886  CYTHON_FALLTHROUGH;
5887  case 13: values[12] = PyTuple_GET_ITEM(__pyx_args, 12);
5888  CYTHON_FALLTHROUGH;
5889  case 12: values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
5890  CYTHON_FALLTHROUGH;
5891  case 11: values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
5892  CYTHON_FALLTHROUGH;
5893  case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
5894  CYTHON_FALLTHROUGH;
5895  case 9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
5896  CYTHON_FALLTHROUGH;
5897  case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
5898  CYTHON_FALLTHROUGH;
5899  case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
5900  CYTHON_FALLTHROUGH;
5901  case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
5902  CYTHON_FALLTHROUGH;
5903  case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
5904  CYTHON_FALLTHROUGH;
5905  case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
5906  CYTHON_FALLTHROUGH;
5907  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
5908  CYTHON_FALLTHROUGH;
5909  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5910  CYTHON_FALLTHROUGH;
5911  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5912  CYTHON_FALLTHROUGH;
5913  case 0: break;
5914  default: goto __pyx_L5_argtuple_error;
5915  }
5916  kw_args = PyDict_Size(__pyx_kwds);
5917  switch (pos_args) {
5918  case 0:
5919  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_comm)) != 0)) kw_args--;
5920  else goto __pyx_L5_argtuple_error;
5921  CYTHON_FALLTHROUGH;
5922  case 1:
5923  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nSpace)) != 0)) kw_args--;
5924  else {
5925  __Pyx_RaiseArgtupleInvalid("buildQuadraticCubeLocal2GlobalMappings", 1, 16, 16, 1); __PYX_ERR(0, 150, __pyx_L3_error)
5926  }
5927  CYTHON_FALLTHROUGH;
5928  case 2:
5929  if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_cmesh)) != 0)) kw_args--;
5930  else {
5931  __Pyx_RaiseArgtupleInvalid("buildQuadraticCubeLocal2GlobalMappings", 1, 16, 16, 2); __PYX_ERR(0, 150, __pyx_L3_error)
5932  }
5933  CYTHON_FALLTHROUGH;
5934  case 3:
5935  if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_subdomain_cmesh)) != 0)) kw_args--;
5936  else {
5937  __Pyx_RaiseArgtupleInvalid("buildQuadraticCubeLocal2GlobalMappings", 1, 16, 16, 3); __PYX_ERR(0, 150, __pyx_L3_error)
5938  }
5939  CYTHON_FALLTHROUGH;
5940  case 4:
5941  if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementOffsets_subdomain_owned)) != 0)) kw_args--;
5942  else {
5943  __Pyx_RaiseArgtupleInvalid("buildQuadraticCubeLocal2GlobalMappings", 1, 16, 16, 4); __PYX_ERR(0, 150, __pyx_L3_error)
5944  }
5945  CYTHON_FALLTHROUGH;
5946  case 5:
5947  if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nodeOffsets_subdomain_owned)) != 0)) kw_args--;
5948  else {
5949  __Pyx_RaiseArgtupleInvalid("buildQuadraticCubeLocal2GlobalMappings", 1, 16, 16, 5); __PYX_ERR(0, 150, __pyx_L3_error)
5950  }
5951  CYTHON_FALLTHROUGH;
5952  case 6:
5953  if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementBoundaryOffsets_subdomain)) != 0)) kw_args--;
5954  else {
5955  __Pyx_RaiseArgtupleInvalid("buildQuadraticCubeLocal2GlobalMappings", 1, 16, 16, 6); __PYX_ERR(0, 150, __pyx_L3_error)
5956  }
5957  CYTHON_FALLTHROUGH;
5958  case 7:
5959  if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_edgeOffsets_subdomain_owned)) != 0)) kw_args--;
5960  else {
5961  __Pyx_RaiseArgtupleInvalid("buildQuadraticCubeLocal2GlobalMappings", 1, 16, 16, 7); __PYX_ERR(0, 150, __pyx_L3_error)
5962  }
5963  CYTHON_FALLTHROUGH;
5964  case 8:
5965  if (likely((values[8] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementNumbering_subdomain2globa)) != 0)) kw_args--;
5966  else {
5967  __Pyx_RaiseArgtupleInvalid("buildQuadraticCubeLocal2GlobalMappings", 1, 16, 16, 8); __PYX_ERR(0, 150, __pyx_L3_error)
5968  }
5969  CYTHON_FALLTHROUGH;
5970  case 9:
5971  if (likely((values[9] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nodeNumbering_subdomain2global)) != 0)) kw_args--;
5972  else {
5973  __Pyx_RaiseArgtupleInvalid("buildQuadraticCubeLocal2GlobalMappings", 1, 16, 16, 9); __PYX_ERR(0, 150, __pyx_L3_error)
5974  }
5975  CYTHON_FALLTHROUGH;
5976  case 10:
5977  if (likely((values[10] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementBoundaryNumbering_subdoma)) != 0)) kw_args--;
5978  else {
5979  __Pyx_RaiseArgtupleInvalid("buildQuadraticCubeLocal2GlobalMappings", 1, 16, 16, 10); __PYX_ERR(0, 150, __pyx_L3_error)
5980  }
5981  CYTHON_FALLTHROUGH;
5982  case 11:
5983  if (likely((values[11] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_edgeNumbering_subdomain2global)) != 0)) kw_args--;
5984  else {
5985  __Pyx_RaiseArgtupleInvalid("buildQuadraticCubeLocal2GlobalMappings", 1, 16, 16, 11); __PYX_ERR(0, 150, __pyx_L3_error)
5986  }
5987  CYTHON_FALLTHROUGH;
5988  case 12:
5989  if (likely((values[12] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_quadratic_dof_offsets_subdomain)) != 0)) kw_args--;
5990  else {
5991  __Pyx_RaiseArgtupleInvalid("buildQuadraticCubeLocal2GlobalMappings", 1, 16, 16, 12); __PYX_ERR(0, 150, __pyx_L3_error)
5992  }
5993  CYTHON_FALLTHROUGH;
5994  case 13:
5995  if (likely((values[13] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_quadratic_subdomain_l2g)) != 0)) kw_args--;
5996  else {
5997  __Pyx_RaiseArgtupleInvalid("buildQuadraticCubeLocal2GlobalMappings", 1, 16, 16, 13); __PYX_ERR(0, 150, __pyx_L3_error)
5998  }
5999  CYTHON_FALLTHROUGH;
6000  case 14:
6001  if (likely((values[14] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_quadraticNumbering_subdomain2glo)) != 0)) kw_args--;
6002  else {
6003  __Pyx_RaiseArgtupleInvalid("buildQuadraticCubeLocal2GlobalMappings", 1, 16, 16, 14); __PYX_ERR(0, 150, __pyx_L3_error)
6004  }
6005  CYTHON_FALLTHROUGH;
6006  case 15:
6007  if (likely((values[15] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_quadratic_lagrangeNodes)) != 0)) kw_args--;
6008  else {
6009  __Pyx_RaiseArgtupleInvalid("buildQuadraticCubeLocal2GlobalMappings", 1, 16, 16, 15); __PYX_ERR(0, 150, __pyx_L3_error)
6010  }
6011  }
6012  if (unlikely(kw_args > 0)) {
6013  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "buildQuadraticCubeLocal2GlobalMappings") < 0)) __PYX_ERR(0, 150, __pyx_L3_error)
6014  }
6015  } else if (PyTuple_GET_SIZE(__pyx_args) != 16) {
6016  goto __pyx_L5_argtuple_error;
6017  } else {
6018  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
6019  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
6020  values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
6021  values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
6022  values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
6023  values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
6024  values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
6025  values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
6026  values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
6027  values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
6028  values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
6029  values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
6030  values[12] = PyTuple_GET_ITEM(__pyx_args, 12);
6031  values[13] = PyTuple_GET_ITEM(__pyx_args, 13);
6032  values[14] = PyTuple_GET_ITEM(__pyx_args, 14);
6033  values[15] = PyTuple_GET_ITEM(__pyx_args, 15);
6034  }
6035  __pyx_v_comm = ((struct PyMPICommObject *)values[0]);
6036  __pyx_v_nSpace = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_nSpace == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 151, __pyx_L3_error)
6037  __pyx_v_cmesh = ((struct __pyx_obj_7proteus_10cmeshTools_CMesh *)values[2]);
6038  __pyx_v_subdomain_cmesh = ((struct __pyx_obj_7proteus_10cmeshTools_CMesh *)values[3]);
6039  __pyx_v_elementOffsets_subdomain_owned = ((PyArrayObject *)values[4]);
6040  __pyx_v_nodeOffsets_subdomain_owned = ((PyArrayObject *)values[5]);
6041  __pyx_v_elementBoundaryOffsets_subdomain_owned = ((PyArrayObject *)values[6]);
6042  __pyx_v_edgeOffsets_subdomain_owned = ((PyArrayObject *)values[7]);
6043  __pyx_v_elementNumbering_subdomain2global = ((PyArrayObject *)values[8]);
6044  __pyx_v_nodeNumbering_subdomain2global = ((PyArrayObject *)values[9]);
6045  __pyx_v_elementBoundaryNumbering_subdomain2global = ((PyArrayObject *)values[10]);
6046  __pyx_v_edgeNumbering_subdomain2global = ((PyArrayObject *)values[11]);
6047  __pyx_v_quadratic_dof_offsets_subdomain_owned = ((PyArrayObject *)values[12]);
6048  __pyx_v_quadratic_subdomain_l2g = ((PyArrayObject *)values[13]);
6049  __pyx_v_quadraticNumbering_subdomain2global = ((PyArrayObject *)values[14]);
6050  __pyx_v_quadratic_lagrangeNodes = ((PyArrayObject *)values[15]);
6051  }
6052  goto __pyx_L4_argument_unpacking_done;
6053  __pyx_L5_argtuple_error:;
6054  __Pyx_RaiseArgtupleInvalid("buildQuadraticCubeLocal2GlobalMappings", 1, 16, 16, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 150, __pyx_L3_error)
6055  __pyx_L3_error:;
6056  __Pyx_AddTraceback("cpartitioning.buildQuadraticCubeLocal2GlobalMappings", __pyx_clineno, __pyx_lineno, __pyx_filename);
6057  __Pyx_RefNannyFinishContext();
6058  return NULL;
6059  __pyx_L4_argument_unpacking_done:;
6060  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_comm), __pyx_ptype_6mpi4py_3MPI_Comm, 1, "comm", 0))) __PYX_ERR(0, 150, __pyx_L1_error)
6061  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_cmesh), __pyx_ptype_7proteus_10cmeshTools_CMesh, 1, "cmesh", 0))) __PYX_ERR(0, 152, __pyx_L1_error)
6062  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_subdomain_cmesh), __pyx_ptype_7proteus_10cmeshTools_CMesh, 1, "subdomain_cmesh", 0))) __PYX_ERR(0, 153, __pyx_L1_error)
6063  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementOffsets_subdomain_owned), __pyx_ptype_5numpy_ndarray, 1, "elementOffsets_subdomain_owned", 0))) __PYX_ERR(0, 154, __pyx_L1_error)
6064  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_nodeOffsets_subdomain_owned), __pyx_ptype_5numpy_ndarray, 1, "nodeOffsets_subdomain_owned", 0))) __PYX_ERR(0, 155, __pyx_L1_error)
6065  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementBoundaryOffsets_subdomain_owned), __pyx_ptype_5numpy_ndarray, 1, "elementBoundaryOffsets_subdomain_owned", 0))) __PYX_ERR(0, 156, __pyx_L1_error)
6066  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_edgeOffsets_subdomain_owned), __pyx_ptype_5numpy_ndarray, 1, "edgeOffsets_subdomain_owned", 0))) __PYX_ERR(0, 157, __pyx_L1_error)
6067  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementNumbering_subdomain2global), __pyx_ptype_5numpy_ndarray, 1, "elementNumbering_subdomain2global", 0))) __PYX_ERR(0, 158, __pyx_L1_error)
6068  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_nodeNumbering_subdomain2global), __pyx_ptype_5numpy_ndarray, 1, "nodeNumbering_subdomain2global", 0))) __PYX_ERR(0, 159, __pyx_L1_error)
6069  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementBoundaryNumbering_subdomain2global), __pyx_ptype_5numpy_ndarray, 1, "elementBoundaryNumbering_subdomain2global", 0))) __PYX_ERR(0, 160, __pyx_L1_error)
6070  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_edgeNumbering_subdomain2global), __pyx_ptype_5numpy_ndarray, 1, "edgeNumbering_subdomain2global", 0))) __PYX_ERR(0, 161, __pyx_L1_error)
6071  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_quadratic_dof_offsets_subdomain_owned), __pyx_ptype_5numpy_ndarray, 1, "quadratic_dof_offsets_subdomain_owned", 0))) __PYX_ERR(0, 162, __pyx_L1_error)
6072  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_quadratic_subdomain_l2g), __pyx_ptype_5numpy_ndarray, 1, "quadratic_subdomain_l2g", 0))) __PYX_ERR(0, 163, __pyx_L1_error)
6073  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_quadraticNumbering_subdomain2global), __pyx_ptype_5numpy_ndarray, 1, "quadraticNumbering_subdomain2global", 0))) __PYX_ERR(0, 164, __pyx_L1_error)
6074  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_quadratic_lagrangeNodes), __pyx_ptype_5numpy_ndarray, 1, "quadratic_lagrangeNodes", 0))) __PYX_ERR(0, 165, __pyx_L1_error)
6075  __pyx_r = __pyx_pf_13cpartitioning_10buildQuadraticCubeLocal2GlobalMappings(__pyx_self, __pyx_v_comm, __pyx_v_nSpace, __pyx_v_cmesh, __pyx_v_subdomain_cmesh, __pyx_v_elementOffsets_subdomain_owned, __pyx_v_nodeOffsets_subdomain_owned, __pyx_v_elementBoundaryOffsets_subdomain_owned, __pyx_v_edgeOffsets_subdomain_owned, __pyx_v_elementNumbering_subdomain2global, __pyx_v_nodeNumbering_subdomain2global, __pyx_v_elementBoundaryNumbering_subdomain2global, __pyx_v_edgeNumbering_subdomain2global, __pyx_v_quadratic_dof_offsets_subdomain_owned, __pyx_v_quadratic_subdomain_l2g, __pyx_v_quadraticNumbering_subdomain2global, __pyx_v_quadratic_lagrangeNodes);
6076 
6077  /* function exit code */
6078  goto __pyx_L0;
6079  __pyx_L1_error:;
6080  __pyx_r = NULL;
6081  __pyx_L0:;
6082  __Pyx_RefNannyFinishContext();
6083  return __pyx_r;
6084 }
6085 
6086 static PyObject *__pyx_pf_13cpartitioning_10buildQuadraticCubeLocal2GlobalMappings(CYTHON_UNUSED PyObject *__pyx_self, struct PyMPICommObject *__pyx_v_comm, int __pyx_v_nSpace, struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_cmesh, CYTHON_UNUSED struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_subdomain_cmesh, CYTHON_UNUSED PyArrayObject *__pyx_v_elementOffsets_subdomain_owned, PyArrayObject *__pyx_v_nodeOffsets_subdomain_owned, CYTHON_UNUSED PyArrayObject *__pyx_v_elementBoundaryOffsets_subdomain_owned, PyArrayObject *__pyx_v_edgeOffsets_subdomain_owned, CYTHON_UNUSED PyArrayObject *__pyx_v_elementNumbering_subdomain2global, PyArrayObject *__pyx_v_nodeNumbering_subdomain2global, CYTHON_UNUSED PyArrayObject *__pyx_v_elementBoundaryNumbering_subdomain2global, PyArrayObject *__pyx_v_edgeNumbering_subdomain2global, PyArrayObject *__pyx_v_quadratic_dof_offsets_subdomain_owned, PyArrayObject *__pyx_v_quadratic_subdomain_l2g, PyArrayObject *__pyx_v_quadraticNumbering_subdomain2global, PyArrayObject *__pyx_v_quadratic_lagrangeNodes) {
6087  int __pyx_v_nDOF_all_processes;
6088  int __pyx_v_nDOF_subdomain;
6089  int __pyx_v_max_dof_neighbors;
6090  PyObject *__pyx_r = NULL;
6091  __Pyx_RefNannyDeclarations
6092  PyObject *__pyx_t_1 = NULL;
6093  PyObject *__pyx_t_2 = NULL;
6094  PyObject *__pyx_t_3 = NULL;
6095  PyObject *__pyx_t_4 = NULL;
6096  __Pyx_RefNannySetupContext("buildQuadraticCubeLocal2GlobalMappings", 0);
6097 
6098  /* "cpartitioning.pyx":166
6099  * np.ndarray quadraticNumbering_subdomain2global,
6100  * np.ndarray quadratic_lagrangeNodes):
6101  * cdef int nDOF_all_processes=0 # <<<<<<<<<<<<<<
6102  * cdef int nDOF_subdomain=0
6103  * cdef int max_dof_neighbors=0
6104  */
6105  __pyx_v_nDOF_all_processes = 0;
6106 
6107  /* "cpartitioning.pyx":167
6108  * np.ndarray quadratic_lagrangeNodes):
6109  * cdef int nDOF_all_processes=0
6110  * cdef int nDOF_subdomain=0 # <<<<<<<<<<<<<<
6111  * cdef int max_dof_neighbors=0
6112  * if nSpace == 1:
6113  */
6114  __pyx_v_nDOF_subdomain = 0;
6115 
6116  /* "cpartitioning.pyx":168
6117  * cdef int nDOF_all_processes=0
6118  * cdef int nDOF_subdomain=0
6119  * cdef int max_dof_neighbors=0 # <<<<<<<<<<<<<<
6120  * if nSpace == 1:
6121  * assert(False),"buildQuadraticCubeSubdomain2GlobalMappings_1d not implemented!!"
6122  */
6123  __pyx_v_max_dof_neighbors = 0;
6124 
6125  /* "cpartitioning.pyx":169
6126  * cdef int nDOF_subdomain=0
6127  * cdef int max_dof_neighbors=0
6128  * if nSpace == 1: # <<<<<<<<<<<<<<
6129  * assert(False),"buildQuadraticCubeSubdomain2GlobalMappings_1d not implemented!!"
6130  * elif nSpace == 2:
6131  */
6132  switch (__pyx_v_nSpace) {
6133  case 1:
6134 
6135  /* "cpartitioning.pyx":170
6136  * cdef int max_dof_neighbors=0
6137  * if nSpace == 1:
6138  * assert(False),"buildQuadraticCubeSubdomain2GlobalMappings_1d not implemented!!" # <<<<<<<<<<<<<<
6139  * elif nSpace == 2:
6140  * assert(False),"buildQuadraticCubeSubdomain2GlobalMappings_2d not implemented!!"
6141  */
6142  #ifndef CYTHON_WITHOUT_ASSERTIONS
6143  if (unlikely(!Py_OptimizeFlag)) {
6144  if (unlikely(!0)) {
6145  PyErr_SetObject(PyExc_AssertionError, __pyx_kp_s_buildQuadraticCubeSubdomain2Glob);
6146  __PYX_ERR(0, 170, __pyx_L1_error)
6147  }
6148  }
6149  #endif
6150 
6151  /* "cpartitioning.pyx":169
6152  * cdef int nDOF_subdomain=0
6153  * cdef int max_dof_neighbors=0
6154  * if nSpace == 1: # <<<<<<<<<<<<<<
6155  * assert(False),"buildQuadraticCubeSubdomain2GlobalMappings_1d not implemented!!"
6156  * elif nSpace == 2:
6157  */
6158  break;
6159  case 2:
6160 
6161  /* "cpartitioning.pyx":172
6162  * assert(False),"buildQuadraticCubeSubdomain2GlobalMappings_1d not implemented!!"
6163  * elif nSpace == 2:
6164  * assert(False),"buildQuadraticCubeSubdomain2GlobalMappings_2d not implemented!!" # <<<<<<<<<<<<<<
6165  * else:
6166  * buildQuadraticCubeSubdomain2GlobalMappings_3d(comm.ob_mpi,
6167  */
6168  #ifndef CYTHON_WITHOUT_ASSERTIONS
6169  if (unlikely(!Py_OptimizeFlag)) {
6170  if (unlikely(!0)) {
6171  PyErr_SetObject(PyExc_AssertionError, __pyx_kp_s_buildQuadraticCubeSubdomain2Glob_2);
6172  __PYX_ERR(0, 172, __pyx_L1_error)
6173  }
6174  }
6175  #endif
6176 
6177  /* "cpartitioning.pyx":171
6178  * if nSpace == 1:
6179  * assert(False),"buildQuadraticCubeSubdomain2GlobalMappings_1d not implemented!!"
6180  * elif nSpace == 2: # <<<<<<<<<<<<<<
6181  * assert(False),"buildQuadraticCubeSubdomain2GlobalMappings_2d not implemented!!"
6182  * else:
6183  */
6184  break;
6185  default:
6186 
6187  /* "cpartitioning.pyx":174
6188  * assert(False),"buildQuadraticCubeSubdomain2GlobalMappings_2d not implemented!!"
6189  * else:
6190  * buildQuadraticCubeSubdomain2GlobalMappings_3d(comm.ob_mpi, # <<<<<<<<<<<<<<
6191  * cmesh.mesh,
6192  * <int*>(edgeOffsets_subdomain_owned.data),
6193  */
6194  (void)(proteus::buildQuadraticCubeSubdomain2GlobalMappings_3d(__pyx_v_comm->ob_mpi, __pyx_v_cmesh->mesh, ((int *)__pyx_v_edgeOffsets_subdomain_owned->data), ((int *)__pyx_v_nodeOffsets_subdomain_owned->data), ((int *)__pyx_v_edgeNumbering_subdomain2global->data), ((int *)__pyx_v_nodeNumbering_subdomain2global->data), __pyx_v_nDOF_all_processes, __pyx_v_nDOF_subdomain, __pyx_v_max_dof_neighbors, ((int *)__pyx_v_quadratic_dof_offsets_subdomain_owned->data), ((int *)__pyx_v_quadratic_subdomain_l2g->data), ((int *)__pyx_v_quadraticNumbering_subdomain2global->data), ((double *)__pyx_v_quadratic_lagrangeNodes->data)));
6195  break;
6196  }
6197 
6198  /* "cpartitioning.pyx":187
6199  * <int*>(quadraticNumbering_subdomain2global.data),
6200  * <double*>(quadratic_lagrangeNodes.data))
6201  * return (nDOF_all_processes, # <<<<<<<<<<<<<<
6202  * nDOF_subdomain,
6203  * max_dof_neighbors)
6204  */
6205  __Pyx_XDECREF(__pyx_r);
6206  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_nDOF_all_processes); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 187, __pyx_L1_error)
6207  __Pyx_GOTREF(__pyx_t_1);
6208 
6209  /* "cpartitioning.pyx":188
6210  * <double*>(quadratic_lagrangeNodes.data))
6211  * return (nDOF_all_processes,
6212  * nDOF_subdomain, # <<<<<<<<<<<<<<
6213  * max_dof_neighbors)
6214  *
6215  */
6216  __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_nDOF_subdomain); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 188, __pyx_L1_error)
6217  __Pyx_GOTREF(__pyx_t_2);
6218 
6219  /* "cpartitioning.pyx":189
6220  * return (nDOF_all_processes,
6221  * nDOF_subdomain,
6222  * max_dof_neighbors) # <<<<<<<<<<<<<<
6223  *
6224  * def buildDiscontinuousGalerkinLocal2GlobalMappings(Comm comm,
6225  */
6226  __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_max_dof_neighbors); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 189, __pyx_L1_error)
6227  __Pyx_GOTREF(__pyx_t_3);
6228 
6229  /* "cpartitioning.pyx":187
6230  * <int*>(quadraticNumbering_subdomain2global.data),
6231  * <double*>(quadratic_lagrangeNodes.data))
6232  * return (nDOF_all_processes, # <<<<<<<<<<<<<<
6233  * nDOF_subdomain,
6234  * max_dof_neighbors)
6235  */
6236  __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 187, __pyx_L1_error)
6237  __Pyx_GOTREF(__pyx_t_4);
6238  __Pyx_GIVEREF(__pyx_t_1);
6239  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
6240  __Pyx_GIVEREF(__pyx_t_2);
6241  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2);
6242  __Pyx_GIVEREF(__pyx_t_3);
6243  PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_3);
6244  __pyx_t_1 = 0;
6245  __pyx_t_2 = 0;
6246  __pyx_t_3 = 0;
6247  __pyx_r = __pyx_t_4;
6248  __pyx_t_4 = 0;
6249  goto __pyx_L0;
6250 
6251  /* "cpartitioning.pyx":150
6252  * max_dof_neighbors)
6253  *
6254  * def buildQuadraticCubeLocal2GlobalMappings(Comm comm, # <<<<<<<<<<<<<<
6255  * int nSpace,
6256  * cmeshTools.CMesh cmesh,
6257  */
6258 
6259  /* function exit code */
6260  __pyx_L1_error:;
6261  __Pyx_XDECREF(__pyx_t_1);
6262  __Pyx_XDECREF(__pyx_t_2);
6263  __Pyx_XDECREF(__pyx_t_3);
6264  __Pyx_XDECREF(__pyx_t_4);
6265  __Pyx_AddTraceback("cpartitioning.buildQuadraticCubeLocal2GlobalMappings", __pyx_clineno, __pyx_lineno, __pyx_filename);
6266  __pyx_r = NULL;
6267  __pyx_L0:;
6268  __Pyx_XGIVEREF(__pyx_r);
6269  __Pyx_RefNannyFinishContext();
6270  return __pyx_r;
6271 }
6272 
6273 /* "cpartitioning.pyx":191
6274  * max_dof_neighbors)
6275  *
6276  * def buildDiscontinuousGalerkinLocal2GlobalMappings(Comm comm, # <<<<<<<<<<<<<<
6277  * int nDOF_element,
6278  * cmeshTools.CMesh cmesh,
6279  */
6280 
6281 /* Python wrapper */
6282 static PyObject *__pyx_pw_13cpartitioning_13buildDiscontinuousGalerkinLocal2GlobalMappings(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
6283 static PyMethodDef __pyx_mdef_13cpartitioning_13buildDiscontinuousGalerkinLocal2GlobalMappings = {"buildDiscontinuousGalerkinLocal2GlobalMappings", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_13cpartitioning_13buildDiscontinuousGalerkinLocal2GlobalMappings, METH_VARARGS|METH_KEYWORDS, 0};
6284 static PyObject *__pyx_pw_13cpartitioning_13buildDiscontinuousGalerkinLocal2GlobalMappings(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
6285  struct PyMPICommObject *__pyx_v_comm = 0;
6286  int __pyx_v_nDOF_element;
6287  struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_cmesh = 0;
6288  CYTHON_UNUSED struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_subdomain_cmesh = 0;
6289  PyArrayObject *__pyx_v_elementOffsets_subdomain_owned = 0;
6290  PyArrayObject *__pyx_v_elementNumbering_subdomain2global = 0;
6291  PyArrayObject *__pyx_v_dg_dof_offsets_subdomain_owned = 0;
6292  PyArrayObject *__pyx_v_dg_subdomain_l2g = 0;
6293  PyArrayObject *__pyx_v_dgNumbering_subdomain2global = 0;
6294  PyObject *__pyx_r = 0;
6295  __Pyx_RefNannyDeclarations
6296  __Pyx_RefNannySetupContext("buildDiscontinuousGalerkinLocal2GlobalMappings (wrapper)", 0);
6297  {
6298  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_comm,&__pyx_n_s_nDOF_element,&__pyx_n_s_cmesh,&__pyx_n_s_subdomain_cmesh,&__pyx_n_s_elementOffsets_subdomain_owned,&__pyx_n_s_elementNumbering_subdomain2globa,&__pyx_n_s_dg_dof_offsets_subdomain_owned,&__pyx_n_s_dg_subdomain_l2g,&__pyx_n_s_dgNumbering_subdomain2global,0};
6299  PyObject* values[9] = {0,0,0,0,0,0,0,0,0};
6300  if (unlikely(__pyx_kwds)) {
6301  Py_ssize_t kw_args;
6302  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
6303  switch (pos_args) {
6304  case 9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
6305  CYTHON_FALLTHROUGH;
6306  case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
6307  CYTHON_FALLTHROUGH;
6308  case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
6309  CYTHON_FALLTHROUGH;
6310  case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
6311  CYTHON_FALLTHROUGH;
6312  case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
6313  CYTHON_FALLTHROUGH;
6314  case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
6315  CYTHON_FALLTHROUGH;
6316  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
6317  CYTHON_FALLTHROUGH;
6318  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
6319  CYTHON_FALLTHROUGH;
6320  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
6321  CYTHON_FALLTHROUGH;
6322  case 0: break;
6323  default: goto __pyx_L5_argtuple_error;
6324  }
6325  kw_args = PyDict_Size(__pyx_kwds);
6326  switch (pos_args) {
6327  case 0:
6328  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_comm)) != 0)) kw_args--;
6329  else goto __pyx_L5_argtuple_error;
6330  CYTHON_FALLTHROUGH;
6331  case 1:
6332  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nDOF_element)) != 0)) kw_args--;
6333  else {
6334  __Pyx_RaiseArgtupleInvalid("buildDiscontinuousGalerkinLocal2GlobalMappings", 1, 9, 9, 1); __PYX_ERR(0, 191, __pyx_L3_error)
6335  }
6336  CYTHON_FALLTHROUGH;
6337  case 2:
6338  if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_cmesh)) != 0)) kw_args--;
6339  else {
6340  __Pyx_RaiseArgtupleInvalid("buildDiscontinuousGalerkinLocal2GlobalMappings", 1, 9, 9, 2); __PYX_ERR(0, 191, __pyx_L3_error)
6341  }
6342  CYTHON_FALLTHROUGH;
6343  case 3:
6344  if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_subdomain_cmesh)) != 0)) kw_args--;
6345  else {
6346  __Pyx_RaiseArgtupleInvalid("buildDiscontinuousGalerkinLocal2GlobalMappings", 1, 9, 9, 3); __PYX_ERR(0, 191, __pyx_L3_error)
6347  }
6348  CYTHON_FALLTHROUGH;
6349  case 4:
6350  if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementOffsets_subdomain_owned)) != 0)) kw_args--;
6351  else {
6352  __Pyx_RaiseArgtupleInvalid("buildDiscontinuousGalerkinLocal2GlobalMappings", 1, 9, 9, 4); __PYX_ERR(0, 191, __pyx_L3_error)
6353  }
6354  CYTHON_FALLTHROUGH;
6355  case 5:
6356  if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementNumbering_subdomain2globa)) != 0)) kw_args--;
6357  else {
6358  __Pyx_RaiseArgtupleInvalid("buildDiscontinuousGalerkinLocal2GlobalMappings", 1, 9, 9, 5); __PYX_ERR(0, 191, __pyx_L3_error)
6359  }
6360  CYTHON_FALLTHROUGH;
6361  case 6:
6362  if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dg_dof_offsets_subdomain_owned)) != 0)) kw_args--;
6363  else {
6364  __Pyx_RaiseArgtupleInvalid("buildDiscontinuousGalerkinLocal2GlobalMappings", 1, 9, 9, 6); __PYX_ERR(0, 191, __pyx_L3_error)
6365  }
6366  CYTHON_FALLTHROUGH;
6367  case 7:
6368  if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dg_subdomain_l2g)) != 0)) kw_args--;
6369  else {
6370  __Pyx_RaiseArgtupleInvalid("buildDiscontinuousGalerkinLocal2GlobalMappings", 1, 9, 9, 7); __PYX_ERR(0, 191, __pyx_L3_error)
6371  }
6372  CYTHON_FALLTHROUGH;
6373  case 8:
6374  if (likely((values[8] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dgNumbering_subdomain2global)) != 0)) kw_args--;
6375  else {
6376  __Pyx_RaiseArgtupleInvalid("buildDiscontinuousGalerkinLocal2GlobalMappings", 1, 9, 9, 8); __PYX_ERR(0, 191, __pyx_L3_error)
6377  }
6378  }
6379  if (unlikely(kw_args > 0)) {
6380  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "buildDiscontinuousGalerkinLocal2GlobalMappings") < 0)) __PYX_ERR(0, 191, __pyx_L3_error)
6381  }
6382  } else if (PyTuple_GET_SIZE(__pyx_args) != 9) {
6383  goto __pyx_L5_argtuple_error;
6384  } else {
6385  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
6386  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
6387  values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
6388  values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
6389  values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
6390  values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
6391  values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
6392  values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
6393  values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
6394  }
6395  __pyx_v_comm = ((struct PyMPICommObject *)values[0]);
6396  __pyx_v_nDOF_element = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_nDOF_element == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 192, __pyx_L3_error)
6397  __pyx_v_cmesh = ((struct __pyx_obj_7proteus_10cmeshTools_CMesh *)values[2]);
6398  __pyx_v_subdomain_cmesh = ((struct __pyx_obj_7proteus_10cmeshTools_CMesh *)values[3]);
6399  __pyx_v_elementOffsets_subdomain_owned = ((PyArrayObject *)values[4]);
6400  __pyx_v_elementNumbering_subdomain2global = ((PyArrayObject *)values[5]);
6401  __pyx_v_dg_dof_offsets_subdomain_owned = ((PyArrayObject *)values[6]);
6402  __pyx_v_dg_subdomain_l2g = ((PyArrayObject *)values[7]);
6403  __pyx_v_dgNumbering_subdomain2global = ((PyArrayObject *)values[8]);
6404  }
6405  goto __pyx_L4_argument_unpacking_done;
6406  __pyx_L5_argtuple_error:;
6407  __Pyx_RaiseArgtupleInvalid("buildDiscontinuousGalerkinLocal2GlobalMappings", 1, 9, 9, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 191, __pyx_L3_error)
6408  __pyx_L3_error:;
6409  __Pyx_AddTraceback("cpartitioning.buildDiscontinuousGalerkinLocal2GlobalMappings", __pyx_clineno, __pyx_lineno, __pyx_filename);
6410  __Pyx_RefNannyFinishContext();
6411  return NULL;
6412  __pyx_L4_argument_unpacking_done:;
6413  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_comm), __pyx_ptype_6mpi4py_3MPI_Comm, 1, "comm", 0))) __PYX_ERR(0, 191, __pyx_L1_error)
6414  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_cmesh), __pyx_ptype_7proteus_10cmeshTools_CMesh, 1, "cmesh", 0))) __PYX_ERR(0, 193, __pyx_L1_error)
6415  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_subdomain_cmesh), __pyx_ptype_7proteus_10cmeshTools_CMesh, 1, "subdomain_cmesh", 0))) __PYX_ERR(0, 194, __pyx_L1_error)
6416  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementOffsets_subdomain_owned), __pyx_ptype_5numpy_ndarray, 1, "elementOffsets_subdomain_owned", 0))) __PYX_ERR(0, 195, __pyx_L1_error)
6417  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementNumbering_subdomain2global), __pyx_ptype_5numpy_ndarray, 1, "elementNumbering_subdomain2global", 0))) __PYX_ERR(0, 196, __pyx_L1_error)
6418  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dg_dof_offsets_subdomain_owned), __pyx_ptype_5numpy_ndarray, 1, "dg_dof_offsets_subdomain_owned", 0))) __PYX_ERR(0, 197, __pyx_L1_error)
6419  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dg_subdomain_l2g), __pyx_ptype_5numpy_ndarray, 1, "dg_subdomain_l2g", 0))) __PYX_ERR(0, 198, __pyx_L1_error)
6420  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dgNumbering_subdomain2global), __pyx_ptype_5numpy_ndarray, 1, "dgNumbering_subdomain2global", 0))) __PYX_ERR(0, 199, __pyx_L1_error)
6421  __pyx_r = __pyx_pf_13cpartitioning_12buildDiscontinuousGalerkinLocal2GlobalMappings(__pyx_self, __pyx_v_comm, __pyx_v_nDOF_element, __pyx_v_cmesh, __pyx_v_subdomain_cmesh, __pyx_v_elementOffsets_subdomain_owned, __pyx_v_elementNumbering_subdomain2global, __pyx_v_dg_dof_offsets_subdomain_owned, __pyx_v_dg_subdomain_l2g, __pyx_v_dgNumbering_subdomain2global);
6422 
6423  /* function exit code */
6424  goto __pyx_L0;
6425  __pyx_L1_error:;
6426  __pyx_r = NULL;
6427  __pyx_L0:;
6428  __Pyx_RefNannyFinishContext();
6429  return __pyx_r;
6430 }
6431 
6432 static PyObject *__pyx_pf_13cpartitioning_12buildDiscontinuousGalerkinLocal2GlobalMappings(CYTHON_UNUSED PyObject *__pyx_self, struct PyMPICommObject *__pyx_v_comm, int __pyx_v_nDOF_element, struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_cmesh, CYTHON_UNUSED struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_subdomain_cmesh, PyArrayObject *__pyx_v_elementOffsets_subdomain_owned, PyArrayObject *__pyx_v_elementNumbering_subdomain2global, PyArrayObject *__pyx_v_dg_dof_offsets_subdomain_owned, PyArrayObject *__pyx_v_dg_subdomain_l2g, PyArrayObject *__pyx_v_dgNumbering_subdomain2global) {
6433  int __pyx_v_nDOF_all_processes;
6434  int __pyx_v_nDOF_subdomain;
6435  int __pyx_v_max_dof_neighbors;
6436  PyObject *__pyx_r = NULL;
6437  __Pyx_RefNannyDeclarations
6438  PyObject *__pyx_t_1 = NULL;
6439  PyObject *__pyx_t_2 = NULL;
6440  PyObject *__pyx_t_3 = NULL;
6441  PyObject *__pyx_t_4 = NULL;
6442  __Pyx_RefNannySetupContext("buildDiscontinuousGalerkinLocal2GlobalMappings", 0);
6443 
6444  /* "cpartitioning.pyx":200
6445  * np.ndarray dg_subdomain_l2g,
6446  * np.ndarray dgNumbering_subdomain2global):
6447  * cdef int nDOF_all_processes=0 # <<<<<<<<<<<<<<
6448  * cdef int nDOF_subdomain=0
6449  * cdef int max_dof_neighbors=0
6450  */
6451  __pyx_v_nDOF_all_processes = 0;
6452 
6453  /* "cpartitioning.pyx":201
6454  * np.ndarray dgNumbering_subdomain2global):
6455  * cdef int nDOF_all_processes=0
6456  * cdef int nDOF_subdomain=0 # <<<<<<<<<<<<<<
6457  * cdef int max_dof_neighbors=0
6458  * buildDiscontinuousGalerkinSubdomain2GlobalMappings(comm.ob_mpi,
6459  */
6460  __pyx_v_nDOF_subdomain = 0;
6461 
6462  /* "cpartitioning.pyx":202
6463  * cdef int nDOF_all_processes=0
6464  * cdef int nDOF_subdomain=0
6465  * cdef int max_dof_neighbors=0 # <<<<<<<<<<<<<<
6466  * buildDiscontinuousGalerkinSubdomain2GlobalMappings(comm.ob_mpi,
6467  * cmesh.mesh,
6468  */
6469  __pyx_v_max_dof_neighbors = 0;
6470 
6471  /* "cpartitioning.pyx":203
6472  * cdef int nDOF_subdomain=0
6473  * cdef int max_dof_neighbors=0
6474  * buildDiscontinuousGalerkinSubdomain2GlobalMappings(comm.ob_mpi, # <<<<<<<<<<<<<<
6475  * cmesh.mesh,
6476  * <int*>(elementOffsets_subdomain_owned.data),
6477  */
6478  (void)(proteus::buildDiscontinuousGalerkinSubdomain2GlobalMappings(__pyx_v_comm->ob_mpi, __pyx_v_cmesh->mesh, ((int *)__pyx_v_elementOffsets_subdomain_owned->data), ((int *)__pyx_v_elementNumbering_subdomain2global->data), __pyx_v_nDOF_element, __pyx_v_nDOF_all_processes, __pyx_v_nDOF_subdomain, __pyx_v_max_dof_neighbors, ((int *)__pyx_v_dg_dof_offsets_subdomain_owned->data), ((int *)__pyx_v_dg_subdomain_l2g->data), ((int *)__pyx_v_dgNumbering_subdomain2global->data)));
6479 
6480  /* "cpartitioning.pyx":214
6481  * <int*>(dg_subdomain_l2g.data),
6482  * <int*>(dgNumbering_subdomain2global.data))
6483  * return (nDOF_all_processes, # <<<<<<<<<<<<<<
6484  * nDOF_subdomain,
6485  * max_dof_neighbors)
6486  */
6487  __Pyx_XDECREF(__pyx_r);
6488  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_nDOF_all_processes); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 214, __pyx_L1_error)
6489  __Pyx_GOTREF(__pyx_t_1);
6490 
6491  /* "cpartitioning.pyx":215
6492  * <int*>(dgNumbering_subdomain2global.data))
6493  * return (nDOF_all_processes,
6494  * nDOF_subdomain, # <<<<<<<<<<<<<<
6495  * max_dof_neighbors)
6496  */
6497  __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_nDOF_subdomain); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 215, __pyx_L1_error)
6498  __Pyx_GOTREF(__pyx_t_2);
6499 
6500  /* "cpartitioning.pyx":216
6501  * return (nDOF_all_processes,
6502  * nDOF_subdomain,
6503  * max_dof_neighbors) # <<<<<<<<<<<<<<
6504  */
6505  __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_max_dof_neighbors); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 216, __pyx_L1_error)
6506  __Pyx_GOTREF(__pyx_t_3);
6507 
6508  /* "cpartitioning.pyx":214
6509  * <int*>(dg_subdomain_l2g.data),
6510  * <int*>(dgNumbering_subdomain2global.data))
6511  * return (nDOF_all_processes, # <<<<<<<<<<<<<<
6512  * nDOF_subdomain,
6513  * max_dof_neighbors)
6514  */
6515  __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 214, __pyx_L1_error)
6516  __Pyx_GOTREF(__pyx_t_4);
6517  __Pyx_GIVEREF(__pyx_t_1);
6518  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
6519  __Pyx_GIVEREF(__pyx_t_2);
6520  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2);
6521  __Pyx_GIVEREF(__pyx_t_3);
6522  PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_3);
6523  __pyx_t_1 = 0;
6524  __pyx_t_2 = 0;
6525  __pyx_t_3 = 0;
6526  __pyx_r = __pyx_t_4;
6527  __pyx_t_4 = 0;
6528  goto __pyx_L0;
6529 
6530  /* "cpartitioning.pyx":191
6531  * max_dof_neighbors)
6532  *
6533  * def buildDiscontinuousGalerkinLocal2GlobalMappings(Comm comm, # <<<<<<<<<<<<<<
6534  * int nDOF_element,
6535  * cmeshTools.CMesh cmesh,
6536  */
6537 
6538  /* function exit code */
6539  __pyx_L1_error:;
6540  __Pyx_XDECREF(__pyx_t_1);
6541  __Pyx_XDECREF(__pyx_t_2);
6542  __Pyx_XDECREF(__pyx_t_3);
6543  __Pyx_XDECREF(__pyx_t_4);
6544  __Pyx_AddTraceback("cpartitioning.buildDiscontinuousGalerkinLocal2GlobalMappings", __pyx_clineno, __pyx_lineno, __pyx_filename);
6545  __pyx_r = NULL;
6546  __pyx_L0:;
6547  __Pyx_XGIVEREF(__pyx_r);
6548  __Pyx_RefNannyFinishContext();
6549  return __pyx_r;
6550 }
6551 
6552 /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":258
6553  * # experimental exception made for __getbuffer__ and __releasebuffer__
6554  * # -- the details of this may change.
6555  * def __getbuffer__(ndarray self, Py_buffer* info, int flags): # <<<<<<<<<<<<<<
6556  * # This implementation of getbuffer is geared towards Cython
6557  * # requirements, and does not yet fulfill the PEP.
6558  */
6559 
6560 /* Python wrapper */
6561 static CYTHON_UNUSED int __pyx_pw_5numpy_7ndarray_1__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
6562 static CYTHON_UNUSED int __pyx_pw_5numpy_7ndarray_1__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
6563  int __pyx_r;
6564  __Pyx_RefNannyDeclarations
6565  __Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0);
6566  __pyx_r = __pyx_pf_5numpy_7ndarray___getbuffer__(((PyArrayObject *)__pyx_v_self), ((Py_buffer *)__pyx_v_info), ((int)__pyx_v_flags));
6567 
6568  /* function exit code */
6569  __Pyx_RefNannyFinishContext();
6570  return __pyx_r;
6571 }
6572 
6573 static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
6574  int __pyx_v_i;
6575  int __pyx_v_ndim;
6576  int __pyx_v_endian_detector;
6577  int __pyx_v_little_endian;
6578  int __pyx_v_t;
6579  char *__pyx_v_f;
6580  PyArray_Descr *__pyx_v_descr = 0;
6581  int __pyx_v_offset;
6582  int __pyx_r;
6583  __Pyx_RefNannyDeclarations
6584  int __pyx_t_1;
6585  int __pyx_t_2;
6586  PyObject *__pyx_t_3 = NULL;
6587  int __pyx_t_4;
6588  int __pyx_t_5;
6589  int __pyx_t_6;
6590  PyArray_Descr *__pyx_t_7;
6591  PyObject *__pyx_t_8 = NULL;
6592  char *__pyx_t_9;
6593  if (__pyx_v_info == NULL) {
6594  PyErr_SetString(PyExc_BufferError, "PyObject_GetBuffer: view==NULL argument is obsolete");
6595  return -1;
6596  }
6597  __Pyx_RefNannySetupContext("__getbuffer__", 0);
6598  __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None);
6599  __Pyx_GIVEREF(__pyx_v_info->obj);
6600 
6601  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":265
6602  *
6603  * cdef int i, ndim
6604  * cdef int endian_detector = 1 # <<<<<<<<<<<<<<
6605  * cdef bint little_endian = ((<char*>&endian_detector)[0] != 0)
6606  *
6607  */
6608  __pyx_v_endian_detector = 1;
6609 
6610  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":266
6611  * cdef int i, ndim
6612  * cdef int endian_detector = 1
6613  * cdef bint little_endian = ((<char*>&endian_detector)[0] != 0) # <<<<<<<<<<<<<<
6614  *
6615  * ndim = PyArray_NDIM(self)
6616  */
6617  __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0);
6618 
6619  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":268
6620  * cdef bint little_endian = ((<char*>&endian_detector)[0] != 0)
6621  *
6622  * ndim = PyArray_NDIM(self) # <<<<<<<<<<<<<<
6623  *
6624  * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)
6625  */
6626  __pyx_v_ndim = PyArray_NDIM(__pyx_v_self);
6627 
6628  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":270
6629  * ndim = PyArray_NDIM(self)
6630  *
6631  * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) # <<<<<<<<<<<<<<
6632  * and not PyArray_CHKFLAGS(self, NPY_ARRAY_C_CONTIGUOUS)):
6633  * raise ValueError(u"ndarray is not C contiguous")
6634  */
6635  __pyx_t_2 = (((__pyx_v_flags & PyBUF_C_CONTIGUOUS) == PyBUF_C_CONTIGUOUS) != 0);
6636  if (__pyx_t_2) {
6637  } else {
6638  __pyx_t_1 = __pyx_t_2;
6639  goto __pyx_L4_bool_binop_done;
6640  }
6641 
6642  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":271
6643  *
6644  * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)
6645  * and not PyArray_CHKFLAGS(self, NPY_ARRAY_C_CONTIGUOUS)): # <<<<<<<<<<<<<<
6646  * raise ValueError(u"ndarray is not C contiguous")
6647  *
6648  */
6649  __pyx_t_2 = ((!(PyArray_CHKFLAGS(__pyx_v_self, NPY_ARRAY_C_CONTIGUOUS) != 0)) != 0);
6650  __pyx_t_1 = __pyx_t_2;
6651  __pyx_L4_bool_binop_done:;
6652 
6653  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":270
6654  * ndim = PyArray_NDIM(self)
6655  *
6656  * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) # <<<<<<<<<<<<<<
6657  * and not PyArray_CHKFLAGS(self, NPY_ARRAY_C_CONTIGUOUS)):
6658  * raise ValueError(u"ndarray is not C contiguous")
6659  */
6660  if (unlikely(__pyx_t_1)) {
6661 
6662  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":272
6663  * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)
6664  * and not PyArray_CHKFLAGS(self, NPY_ARRAY_C_CONTIGUOUS)):
6665  * raise ValueError(u"ndarray is not C contiguous") # <<<<<<<<<<<<<<
6666  *
6667  * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)
6668  */
6669  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 272, __pyx_L1_error)
6670  __Pyx_GOTREF(__pyx_t_3);
6671  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
6672  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6673  __PYX_ERR(1, 272, __pyx_L1_error)
6674 
6675  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":270
6676  * ndim = PyArray_NDIM(self)
6677  *
6678  * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) # <<<<<<<<<<<<<<
6679  * and not PyArray_CHKFLAGS(self, NPY_ARRAY_C_CONTIGUOUS)):
6680  * raise ValueError(u"ndarray is not C contiguous")
6681  */
6682  }
6683 
6684  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":274
6685  * raise ValueError(u"ndarray is not C contiguous")
6686  *
6687  * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) # <<<<<<<<<<<<<<
6688  * and not PyArray_CHKFLAGS(self, NPY_ARRAY_F_CONTIGUOUS)):
6689  * raise ValueError(u"ndarray is not Fortran contiguous")
6690  */
6691  __pyx_t_2 = (((__pyx_v_flags & PyBUF_F_CONTIGUOUS) == PyBUF_F_CONTIGUOUS) != 0);
6692  if (__pyx_t_2) {
6693  } else {
6694  __pyx_t_1 = __pyx_t_2;
6695  goto __pyx_L7_bool_binop_done;
6696  }
6697 
6698  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":275
6699  *
6700  * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)
6701  * and not PyArray_CHKFLAGS(self, NPY_ARRAY_F_CONTIGUOUS)): # <<<<<<<<<<<<<<
6702  * raise ValueError(u"ndarray is not Fortran contiguous")
6703  *
6704  */
6705  __pyx_t_2 = ((!(PyArray_CHKFLAGS(__pyx_v_self, NPY_ARRAY_F_CONTIGUOUS) != 0)) != 0);
6706  __pyx_t_1 = __pyx_t_2;
6707  __pyx_L7_bool_binop_done:;
6708 
6709  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":274
6710  * raise ValueError(u"ndarray is not C contiguous")
6711  *
6712  * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) # <<<<<<<<<<<<<<
6713  * and not PyArray_CHKFLAGS(self, NPY_ARRAY_F_CONTIGUOUS)):
6714  * raise ValueError(u"ndarray is not Fortran contiguous")
6715  */
6716  if (unlikely(__pyx_t_1)) {
6717 
6718  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":276
6719  * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)
6720  * and not PyArray_CHKFLAGS(self, NPY_ARRAY_F_CONTIGUOUS)):
6721  * raise ValueError(u"ndarray is not Fortran contiguous") # <<<<<<<<<<<<<<
6722  *
6723  * info.buf = PyArray_DATA(self)
6724  */
6725  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 276, __pyx_L1_error)
6726  __Pyx_GOTREF(__pyx_t_3);
6727  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
6728  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6729  __PYX_ERR(1, 276, __pyx_L1_error)
6730 
6731  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":274
6732  * raise ValueError(u"ndarray is not C contiguous")
6733  *
6734  * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) # <<<<<<<<<<<<<<
6735  * and not PyArray_CHKFLAGS(self, NPY_ARRAY_F_CONTIGUOUS)):
6736  * raise ValueError(u"ndarray is not Fortran contiguous")
6737  */
6738  }
6739 
6740  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":278
6741  * raise ValueError(u"ndarray is not Fortran contiguous")
6742  *
6743  * info.buf = PyArray_DATA(self) # <<<<<<<<<<<<<<
6744  * info.ndim = ndim
6745  * if sizeof(npy_intp) != sizeof(Py_ssize_t):
6746  */
6747  __pyx_v_info->buf = PyArray_DATA(__pyx_v_self);
6748 
6749  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":279
6750  *
6751  * info.buf = PyArray_DATA(self)
6752  * info.ndim = ndim # <<<<<<<<<<<<<<
6753  * if sizeof(npy_intp) != sizeof(Py_ssize_t):
6754  * # Allocate new buffer for strides and shape info.
6755  */
6756  __pyx_v_info->ndim = __pyx_v_ndim;
6757 
6758  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":280
6759  * info.buf = PyArray_DATA(self)
6760  * info.ndim = ndim
6761  * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<<
6762  * # Allocate new buffer for strides and shape info.
6763  * # This is allocated as one block, strides first.
6764  */
6765  __pyx_t_1 = (((sizeof(npy_intp)) != (sizeof(Py_ssize_t))) != 0);
6766  if (__pyx_t_1) {
6767 
6768  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":283
6769  * # Allocate new buffer for strides and shape info.
6770  * # This is allocated as one block, strides first.
6771  * info.strides = <Py_ssize_t*>PyObject_Malloc(sizeof(Py_ssize_t) * 2 * <size_t>ndim) # <<<<<<<<<<<<<<
6772  * info.shape = info.strides + ndim
6773  * for i in range(ndim):
6774  */
6775  __pyx_v_info->strides = ((Py_ssize_t *)PyObject_Malloc((((sizeof(Py_ssize_t)) * 2) * ((size_t)__pyx_v_ndim))));
6776 
6777  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":284
6778  * # This is allocated as one block, strides first.
6779  * info.strides = <Py_ssize_t*>PyObject_Malloc(sizeof(Py_ssize_t) * 2 * <size_t>ndim)
6780  * info.shape = info.strides + ndim # <<<<<<<<<<<<<<
6781  * for i in range(ndim):
6782  * info.strides[i] = PyArray_STRIDES(self)[i]
6783  */
6784  __pyx_v_info->shape = (__pyx_v_info->strides + __pyx_v_ndim);
6785 
6786  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":285
6787  * info.strides = <Py_ssize_t*>PyObject_Malloc(sizeof(Py_ssize_t) * 2 * <size_t>ndim)
6788  * info.shape = info.strides + ndim
6789  * for i in range(ndim): # <<<<<<<<<<<<<<
6790  * info.strides[i] = PyArray_STRIDES(self)[i]
6791  * info.shape[i] = PyArray_DIMS(self)[i]
6792  */
6793  __pyx_t_4 = __pyx_v_ndim;
6794  __pyx_t_5 = __pyx_t_4;
6795  for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
6796  __pyx_v_i = __pyx_t_6;
6797 
6798  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":286
6799  * info.shape = info.strides + ndim
6800  * for i in range(ndim):
6801  * info.strides[i] = PyArray_STRIDES(self)[i] # <<<<<<<<<<<<<<
6802  * info.shape[i] = PyArray_DIMS(self)[i]
6803  * else:
6804  */
6805  (__pyx_v_info->strides[__pyx_v_i]) = (PyArray_STRIDES(__pyx_v_self)[__pyx_v_i]);
6806 
6807  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":287
6808  * for i in range(ndim):
6809  * info.strides[i] = PyArray_STRIDES(self)[i]
6810  * info.shape[i] = PyArray_DIMS(self)[i] # <<<<<<<<<<<<<<
6811  * else:
6812  * info.strides = <Py_ssize_t*>PyArray_STRIDES(self)
6813  */
6814  (__pyx_v_info->shape[__pyx_v_i]) = (PyArray_DIMS(__pyx_v_self)[__pyx_v_i]);
6815  }
6816 
6817  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":280
6818  * info.buf = PyArray_DATA(self)
6819  * info.ndim = ndim
6820  * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<<
6821  * # Allocate new buffer for strides and shape info.
6822  * # This is allocated as one block, strides first.
6823  */
6824  goto __pyx_L9;
6825  }
6826 
6827  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":289
6828  * info.shape[i] = PyArray_DIMS(self)[i]
6829  * else:
6830  * info.strides = <Py_ssize_t*>PyArray_STRIDES(self) # <<<<<<<<<<<<<<
6831  * info.shape = <Py_ssize_t*>PyArray_DIMS(self)
6832  * info.suboffsets = NULL
6833  */
6834  /*else*/ {
6835  __pyx_v_info->strides = ((Py_ssize_t *)PyArray_STRIDES(__pyx_v_self));
6836 
6837  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":290
6838  * else:
6839  * info.strides = <Py_ssize_t*>PyArray_STRIDES(self)
6840  * info.shape = <Py_ssize_t*>PyArray_DIMS(self) # <<<<<<<<<<<<<<
6841  * info.suboffsets = NULL
6842  * info.itemsize = PyArray_ITEMSIZE(self)
6843  */
6844  __pyx_v_info->shape = ((Py_ssize_t *)PyArray_DIMS(__pyx_v_self));
6845  }
6846  __pyx_L9:;
6847 
6848  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":291
6849  * info.strides = <Py_ssize_t*>PyArray_STRIDES(self)
6850  * info.shape = <Py_ssize_t*>PyArray_DIMS(self)
6851  * info.suboffsets = NULL # <<<<<<<<<<<<<<
6852  * info.itemsize = PyArray_ITEMSIZE(self)
6853  * info.readonly = not PyArray_ISWRITEABLE(self)
6854  */
6855  __pyx_v_info->suboffsets = NULL;
6856 
6857  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":292
6858  * info.shape = <Py_ssize_t*>PyArray_DIMS(self)
6859  * info.suboffsets = NULL
6860  * info.itemsize = PyArray_ITEMSIZE(self) # <<<<<<<<<<<<<<
6861  * info.readonly = not PyArray_ISWRITEABLE(self)
6862  *
6863  */
6864  __pyx_v_info->itemsize = PyArray_ITEMSIZE(__pyx_v_self);
6865 
6866  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":293
6867  * info.suboffsets = NULL
6868  * info.itemsize = PyArray_ITEMSIZE(self)
6869  * info.readonly = not PyArray_ISWRITEABLE(self) # <<<<<<<<<<<<<<
6870  *
6871  * cdef int t
6872  */
6873  __pyx_v_info->readonly = (!(PyArray_ISWRITEABLE(__pyx_v_self) != 0));
6874 
6875  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":296
6876  *
6877  * cdef int t
6878  * cdef char* f = NULL # <<<<<<<<<<<<<<
6879  * cdef dtype descr = <dtype>PyArray_DESCR(self)
6880  * cdef int offset
6881  */
6882  __pyx_v_f = NULL;
6883 
6884  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":297
6885  * cdef int t
6886  * cdef char* f = NULL
6887  * cdef dtype descr = <dtype>PyArray_DESCR(self) # <<<<<<<<<<<<<<
6888  * cdef int offset
6889  *
6890  */
6891  __pyx_t_7 = PyArray_DESCR(__pyx_v_self);
6892  __pyx_t_3 = ((PyObject *)__pyx_t_7);
6893  __Pyx_INCREF(__pyx_t_3);
6894  __pyx_v_descr = ((PyArray_Descr *)__pyx_t_3);
6895  __pyx_t_3 = 0;
6896 
6897  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":300
6898  * cdef int offset
6899  *
6900  * info.obj = self # <<<<<<<<<<<<<<
6901  *
6902  * if not PyDataType_HASFIELDS(descr):
6903  */
6904  __Pyx_INCREF(((PyObject *)__pyx_v_self));
6905  __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
6906  __Pyx_GOTREF(__pyx_v_info->obj);
6907  __Pyx_DECREF(__pyx_v_info->obj);
6908  __pyx_v_info->obj = ((PyObject *)__pyx_v_self);
6909 
6910  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":302
6911  * info.obj = self
6912  *
6913  * if not PyDataType_HASFIELDS(descr): # <<<<<<<<<<<<<<
6914  * t = descr.type_num
6915  * if ((descr.byteorder == c'>' and little_endian) or
6916  */
6917  __pyx_t_1 = ((!(PyDataType_HASFIELDS(__pyx_v_descr) != 0)) != 0);
6918  if (__pyx_t_1) {
6919 
6920  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":303
6921  *
6922  * if not PyDataType_HASFIELDS(descr):
6923  * t = descr.type_num # <<<<<<<<<<<<<<
6924  * if ((descr.byteorder == c'>' and little_endian) or
6925  * (descr.byteorder == c'<' and not little_endian)):
6926  */
6927  __pyx_t_4 = __pyx_v_descr->type_num;
6928  __pyx_v_t = __pyx_t_4;
6929 
6930  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":304
6931  * if not PyDataType_HASFIELDS(descr):
6932  * t = descr.type_num
6933  * if ((descr.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<<
6934  * (descr.byteorder == c'<' and not little_endian)):
6935  * raise ValueError(u"Non-native byte order not supported")
6936  */
6937  __pyx_t_2 = ((__pyx_v_descr->byteorder == '>') != 0);
6938  if (!__pyx_t_2) {
6939  goto __pyx_L15_next_or;
6940  } else {
6941  }
6942  __pyx_t_2 = (__pyx_v_little_endian != 0);
6943  if (!__pyx_t_2) {
6944  } else {
6945  __pyx_t_1 = __pyx_t_2;
6946  goto __pyx_L14_bool_binop_done;
6947  }
6948  __pyx_L15_next_or:;
6949 
6950  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":305
6951  * t = descr.type_num
6952  * if ((descr.byteorder == c'>' and little_endian) or
6953  * (descr.byteorder == c'<' and not little_endian)): # <<<<<<<<<<<<<<
6954  * raise ValueError(u"Non-native byte order not supported")
6955  * if t == NPY_BYTE: f = "b"
6956  */
6957  __pyx_t_2 = ((__pyx_v_descr->byteorder == '<') != 0);
6958  if (__pyx_t_2) {
6959  } else {
6960  __pyx_t_1 = __pyx_t_2;
6961  goto __pyx_L14_bool_binop_done;
6962  }
6963  __pyx_t_2 = ((!(__pyx_v_little_endian != 0)) != 0);
6964  __pyx_t_1 = __pyx_t_2;
6965  __pyx_L14_bool_binop_done:;
6966 
6967  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":304
6968  * if not PyDataType_HASFIELDS(descr):
6969  * t = descr.type_num
6970  * if ((descr.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<<
6971  * (descr.byteorder == c'<' and not little_endian)):
6972  * raise ValueError(u"Non-native byte order not supported")
6973  */
6974  if (unlikely(__pyx_t_1)) {
6975 
6976  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":306
6977  * if ((descr.byteorder == c'>' and little_endian) or
6978  * (descr.byteorder == c'<' and not little_endian)):
6979  * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<<
6980  * if t == NPY_BYTE: f = "b"
6981  * elif t == NPY_UBYTE: f = "B"
6982  */
6983  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 306, __pyx_L1_error)
6984  __Pyx_GOTREF(__pyx_t_3);
6985  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
6986  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6987  __PYX_ERR(1, 306, __pyx_L1_error)
6988 
6989  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":304
6990  * if not PyDataType_HASFIELDS(descr):
6991  * t = descr.type_num
6992  * if ((descr.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<<
6993  * (descr.byteorder == c'<' and not little_endian)):
6994  * raise ValueError(u"Non-native byte order not supported")
6995  */
6996  }
6997 
6998  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":307
6999  * (descr.byteorder == c'<' and not little_endian)):
7000  * raise ValueError(u"Non-native byte order not supported")
7001  * if t == NPY_BYTE: f = "b" # <<<<<<<<<<<<<<
7002  * elif t == NPY_UBYTE: f = "B"
7003  * elif t == NPY_SHORT: f = "h"
7004  */
7005  switch (__pyx_v_t) {
7006  case NPY_BYTE:
7007  __pyx_v_f = ((char *)"b");
7008  break;
7009  case NPY_UBYTE:
7010 
7011  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":308
7012  * raise ValueError(u"Non-native byte order not supported")
7013  * if t == NPY_BYTE: f = "b"
7014  * elif t == NPY_UBYTE: f = "B" # <<<<<<<<<<<<<<
7015  * elif t == NPY_SHORT: f = "h"
7016  * elif t == NPY_USHORT: f = "H"
7017  */
7018  __pyx_v_f = ((char *)"B");
7019  break;
7020  case NPY_SHORT:
7021 
7022  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":309
7023  * if t == NPY_BYTE: f = "b"
7024  * elif t == NPY_UBYTE: f = "B"
7025  * elif t == NPY_SHORT: f = "h" # <<<<<<<<<<<<<<
7026  * elif t == NPY_USHORT: f = "H"
7027  * elif t == NPY_INT: f = "i"
7028  */
7029  __pyx_v_f = ((char *)"h");
7030  break;
7031  case NPY_USHORT:
7032 
7033  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":310
7034  * elif t == NPY_UBYTE: f = "B"
7035  * elif t == NPY_SHORT: f = "h"
7036  * elif t == NPY_USHORT: f = "H" # <<<<<<<<<<<<<<
7037  * elif t == NPY_INT: f = "i"
7038  * elif t == NPY_UINT: f = "I"
7039  */
7040  __pyx_v_f = ((char *)"H");
7041  break;
7042  case NPY_INT:
7043 
7044  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":311
7045  * elif t == NPY_SHORT: f = "h"
7046  * elif t == NPY_USHORT: f = "H"
7047  * elif t == NPY_INT: f = "i" # <<<<<<<<<<<<<<
7048  * elif t == NPY_UINT: f = "I"
7049  * elif t == NPY_LONG: f = "l"
7050  */
7051  __pyx_v_f = ((char *)"i");
7052  break;
7053  case NPY_UINT:
7054 
7055  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":312
7056  * elif t == NPY_USHORT: f = "H"
7057  * elif t == NPY_INT: f = "i"
7058  * elif t == NPY_UINT: f = "I" # <<<<<<<<<<<<<<
7059  * elif t == NPY_LONG: f = "l"
7060  * elif t == NPY_ULONG: f = "L"
7061  */
7062  __pyx_v_f = ((char *)"I");
7063  break;
7064  case NPY_LONG:
7065 
7066  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":313
7067  * elif t == NPY_INT: f = "i"
7068  * elif t == NPY_UINT: f = "I"
7069  * elif t == NPY_LONG: f = "l" # <<<<<<<<<<<<<<
7070  * elif t == NPY_ULONG: f = "L"
7071  * elif t == NPY_LONGLONG: f = "q"
7072  */
7073  __pyx_v_f = ((char *)"l");
7074  break;
7075  case NPY_ULONG:
7076 
7077  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":314
7078  * elif t == NPY_UINT: f = "I"
7079  * elif t == NPY_LONG: f = "l"
7080  * elif t == NPY_ULONG: f = "L" # <<<<<<<<<<<<<<
7081  * elif t == NPY_LONGLONG: f = "q"
7082  * elif t == NPY_ULONGLONG: f = "Q"
7083  */
7084  __pyx_v_f = ((char *)"L");
7085  break;
7086  case NPY_LONGLONG:
7087 
7088  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":315
7089  * elif t == NPY_LONG: f = "l"
7090  * elif t == NPY_ULONG: f = "L"
7091  * elif t == NPY_LONGLONG: f = "q" # <<<<<<<<<<<<<<
7092  * elif t == NPY_ULONGLONG: f = "Q"
7093  * elif t == NPY_FLOAT: f = "f"
7094  */
7095  __pyx_v_f = ((char *)"q");
7096  break;
7097  case NPY_ULONGLONG:
7098 
7099  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":316
7100  * elif t == NPY_ULONG: f = "L"
7101  * elif t == NPY_LONGLONG: f = "q"
7102  * elif t == NPY_ULONGLONG: f = "Q" # <<<<<<<<<<<<<<
7103  * elif t == NPY_FLOAT: f = "f"
7104  * elif t == NPY_DOUBLE: f = "d"
7105  */
7106  __pyx_v_f = ((char *)"Q");
7107  break;
7108  case NPY_FLOAT:
7109 
7110  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":317
7111  * elif t == NPY_LONGLONG: f = "q"
7112  * elif t == NPY_ULONGLONG: f = "Q"
7113  * elif t == NPY_FLOAT: f = "f" # <<<<<<<<<<<<<<
7114  * elif t == NPY_DOUBLE: f = "d"
7115  * elif t == NPY_LONGDOUBLE: f = "g"
7116  */
7117  __pyx_v_f = ((char *)"f");
7118  break;
7119  case NPY_DOUBLE:
7120 
7121  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":318
7122  * elif t == NPY_ULONGLONG: f = "Q"
7123  * elif t == NPY_FLOAT: f = "f"
7124  * elif t == NPY_DOUBLE: f = "d" # <<<<<<<<<<<<<<
7125  * elif t == NPY_LONGDOUBLE: f = "g"
7126  * elif t == NPY_CFLOAT: f = "Zf"
7127  */
7128  __pyx_v_f = ((char *)"d");
7129  break;
7130  case NPY_LONGDOUBLE:
7131 
7132  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":319
7133  * elif t == NPY_FLOAT: f = "f"
7134  * elif t == NPY_DOUBLE: f = "d"
7135  * elif t == NPY_LONGDOUBLE: f = "g" # <<<<<<<<<<<<<<
7136  * elif t == NPY_CFLOAT: f = "Zf"
7137  * elif t == NPY_CDOUBLE: f = "Zd"
7138  */
7139  __pyx_v_f = ((char *)"g");
7140  break;
7141  case NPY_CFLOAT:
7142 
7143  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":320
7144  * elif t == NPY_DOUBLE: f = "d"
7145  * elif t == NPY_LONGDOUBLE: f = "g"
7146  * elif t == NPY_CFLOAT: f = "Zf" # <<<<<<<<<<<<<<
7147  * elif t == NPY_CDOUBLE: f = "Zd"
7148  * elif t == NPY_CLONGDOUBLE: f = "Zg"
7149  */
7150  __pyx_v_f = ((char *)"Zf");
7151  break;
7152  case NPY_CDOUBLE:
7153 
7154  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":321
7155  * elif t == NPY_LONGDOUBLE: f = "g"
7156  * elif t == NPY_CFLOAT: f = "Zf"
7157  * elif t == NPY_CDOUBLE: f = "Zd" # <<<<<<<<<<<<<<
7158  * elif t == NPY_CLONGDOUBLE: f = "Zg"
7159  * elif t == NPY_OBJECT: f = "O"
7160  */
7161  __pyx_v_f = ((char *)"Zd");
7162  break;
7163  case NPY_CLONGDOUBLE:
7164 
7165  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":322
7166  * elif t == NPY_CFLOAT: f = "Zf"
7167  * elif t == NPY_CDOUBLE: f = "Zd"
7168  * elif t == NPY_CLONGDOUBLE: f = "Zg" # <<<<<<<<<<<<<<
7169  * elif t == NPY_OBJECT: f = "O"
7170  * else:
7171  */
7172  __pyx_v_f = ((char *)"Zg");
7173  break;
7174  case NPY_OBJECT:
7175 
7176  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":323
7177  * elif t == NPY_CDOUBLE: f = "Zd"
7178  * elif t == NPY_CLONGDOUBLE: f = "Zg"
7179  * elif t == NPY_OBJECT: f = "O" # <<<<<<<<<<<<<<
7180  * else:
7181  * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
7182  */
7183  __pyx_v_f = ((char *)"O");
7184  break;
7185  default:
7186 
7187  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":325
7188  * elif t == NPY_OBJECT: f = "O"
7189  * else:
7190  * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) # <<<<<<<<<<<<<<
7191  * info.format = f
7192  * return
7193  */
7194  __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_t); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 325, __pyx_L1_error)
7195  __Pyx_GOTREF(__pyx_t_3);
7196  __pyx_t_8 = PyUnicode_Format(__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_t_3); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 325, __pyx_L1_error)
7197  __Pyx_GOTREF(__pyx_t_8);
7198  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7199  __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 325, __pyx_L1_error)
7200  __Pyx_GOTREF(__pyx_t_3);
7201  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
7202  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
7203  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7204  __PYX_ERR(1, 325, __pyx_L1_error)
7205  break;
7206  }
7207 
7208  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":326
7209  * else:
7210  * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
7211  * info.format = f # <<<<<<<<<<<<<<
7212  * return
7213  * else:
7214  */
7215  __pyx_v_info->format = __pyx_v_f;
7216 
7217  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":327
7218  * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
7219  * info.format = f
7220  * return # <<<<<<<<<<<<<<
7221  * else:
7222  * info.format = <char*>PyObject_Malloc(_buffer_format_string_len)
7223  */
7224  __pyx_r = 0;
7225  goto __pyx_L0;
7226 
7227  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":302
7228  * info.obj = self
7229  *
7230  * if not PyDataType_HASFIELDS(descr): # <<<<<<<<<<<<<<
7231  * t = descr.type_num
7232  * if ((descr.byteorder == c'>' and little_endian) or
7233  */
7234  }
7235 
7236  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":329
7237  * return
7238  * else:
7239  * info.format = <char*>PyObject_Malloc(_buffer_format_string_len) # <<<<<<<<<<<<<<
7240  * info.format[0] = c'^' # Native data types, manual alignment
7241  * offset = 0
7242  */
7243  /*else*/ {
7244  __pyx_v_info->format = ((char *)PyObject_Malloc(0xFF));
7245 
7246  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":330
7247  * else:
7248  * info.format = <char*>PyObject_Malloc(_buffer_format_string_len)
7249  * info.format[0] = c'^' # Native data types, manual alignment # <<<<<<<<<<<<<<
7250  * offset = 0
7251  * f = _util_dtypestring(descr, info.format + 1,
7252  */
7253  (__pyx_v_info->format[0]) = '^';
7254 
7255  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":331
7256  * info.format = <char*>PyObject_Malloc(_buffer_format_string_len)
7257  * info.format[0] = c'^' # Native data types, manual alignment
7258  * offset = 0 # <<<<<<<<<<<<<<
7259  * f = _util_dtypestring(descr, info.format + 1,
7260  * info.format + _buffer_format_string_len,
7261  */
7262  __pyx_v_offset = 0;
7263 
7264  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":332
7265  * info.format[0] = c'^' # Native data types, manual alignment
7266  * offset = 0
7267  * f = _util_dtypestring(descr, info.format + 1, # <<<<<<<<<<<<<<
7268  * info.format + _buffer_format_string_len,
7269  * &offset)
7270  */
7271  __pyx_t_9 = __pyx_f_5numpy__util_dtypestring(__pyx_v_descr, (__pyx_v_info->format + 1), (__pyx_v_info->format + 0xFF), (&__pyx_v_offset)); if (unlikely(__pyx_t_9 == ((char *)NULL))) __PYX_ERR(1, 332, __pyx_L1_error)
7272  __pyx_v_f = __pyx_t_9;
7273 
7274  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":335
7275  * info.format + _buffer_format_string_len,
7276  * &offset)
7277  * f[0] = c'\0' # Terminate format string # <<<<<<<<<<<<<<
7278  *
7279  * def __releasebuffer__(ndarray self, Py_buffer* info):
7280  */
7281  (__pyx_v_f[0]) = '\x00';
7282  }
7283 
7284  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":258
7285  * # experimental exception made for __getbuffer__ and __releasebuffer__
7286  * # -- the details of this may change.
7287  * def __getbuffer__(ndarray self, Py_buffer* info, int flags): # <<<<<<<<<<<<<<
7288  * # This implementation of getbuffer is geared towards Cython
7289  * # requirements, and does not yet fulfill the PEP.
7290  */
7291 
7292  /* function exit code */
7293  __pyx_r = 0;
7294  goto __pyx_L0;
7295  __pyx_L1_error:;
7296  __Pyx_XDECREF(__pyx_t_3);
7297  __Pyx_XDECREF(__pyx_t_8);
7298  __Pyx_AddTraceback("numpy.ndarray.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename);
7299  __pyx_r = -1;
7300  if (__pyx_v_info->obj != NULL) {
7301  __Pyx_GOTREF(__pyx_v_info->obj);
7302  __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
7303  }
7304  goto __pyx_L2;
7305  __pyx_L0:;
7306  if (__pyx_v_info->obj == Py_None) {
7307  __Pyx_GOTREF(__pyx_v_info->obj);
7308  __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
7309  }
7310  __pyx_L2:;
7311  __Pyx_XDECREF((PyObject *)__pyx_v_descr);
7312  __Pyx_RefNannyFinishContext();
7313  return __pyx_r;
7314 }
7315 
7316 /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":337
7317  * f[0] = c'\0' # Terminate format string
7318  *
7319  * def __releasebuffer__(ndarray self, Py_buffer* info): # <<<<<<<<<<<<<<
7320  * if PyArray_HASFIELDS(self):
7321  * PyObject_Free(info.format)
7322  */
7323 
7324 /* Python wrapper */
7325 static CYTHON_UNUSED void __pyx_pw_5numpy_7ndarray_3__releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info); /*proto*/
7326 static CYTHON_UNUSED void __pyx_pw_5numpy_7ndarray_3__releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info) {
7327  __Pyx_RefNannyDeclarations
7328  __Pyx_RefNannySetupContext("__releasebuffer__ (wrapper)", 0);
7329  __pyx_pf_5numpy_7ndarray_2__releasebuffer__(((PyArrayObject *)__pyx_v_self), ((Py_buffer *)__pyx_v_info));
7330 
7331  /* function exit code */
7332  __Pyx_RefNannyFinishContext();
7333 }
7334 
7335 static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info) {
7336  __Pyx_RefNannyDeclarations
7337  int __pyx_t_1;
7338  __Pyx_RefNannySetupContext("__releasebuffer__", 0);
7339 
7340  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":338
7341  *
7342  * def __releasebuffer__(ndarray self, Py_buffer* info):
7343  * if PyArray_HASFIELDS(self): # <<<<<<<<<<<<<<
7344  * PyObject_Free(info.format)
7345  * if sizeof(npy_intp) != sizeof(Py_ssize_t):
7346  */
7347  __pyx_t_1 = (PyArray_HASFIELDS(__pyx_v_self) != 0);
7348  if (__pyx_t_1) {
7349 
7350  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":339
7351  * def __releasebuffer__(ndarray self, Py_buffer* info):
7352  * if PyArray_HASFIELDS(self):
7353  * PyObject_Free(info.format) # <<<<<<<<<<<<<<
7354  * if sizeof(npy_intp) != sizeof(Py_ssize_t):
7355  * PyObject_Free(info.strides)
7356  */
7357  PyObject_Free(__pyx_v_info->format);
7358 
7359  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":338
7360  *
7361  * def __releasebuffer__(ndarray self, Py_buffer* info):
7362  * if PyArray_HASFIELDS(self): # <<<<<<<<<<<<<<
7363  * PyObject_Free(info.format)
7364  * if sizeof(npy_intp) != sizeof(Py_ssize_t):
7365  */
7366  }
7367 
7368  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":340
7369  * if PyArray_HASFIELDS(self):
7370  * PyObject_Free(info.format)
7371  * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<<
7372  * PyObject_Free(info.strides)
7373  * # info.shape was stored after info.strides in the same block
7374  */
7375  __pyx_t_1 = (((sizeof(npy_intp)) != (sizeof(Py_ssize_t))) != 0);
7376  if (__pyx_t_1) {
7377 
7378  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":341
7379  * PyObject_Free(info.format)
7380  * if sizeof(npy_intp) != sizeof(Py_ssize_t):
7381  * PyObject_Free(info.strides) # <<<<<<<<<<<<<<
7382  * # info.shape was stored after info.strides in the same block
7383  *
7384  */
7385  PyObject_Free(__pyx_v_info->strides);
7386 
7387  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":340
7388  * if PyArray_HASFIELDS(self):
7389  * PyObject_Free(info.format)
7390  * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<<
7391  * PyObject_Free(info.strides)
7392  * # info.shape was stored after info.strides in the same block
7393  */
7394  }
7395 
7396  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":337
7397  * f[0] = c'\0' # Terminate format string
7398  *
7399  * def __releasebuffer__(ndarray self, Py_buffer* info): # <<<<<<<<<<<<<<
7400  * if PyArray_HASFIELDS(self):
7401  * PyObject_Free(info.format)
7402  */
7403 
7404  /* function exit code */
7405  __Pyx_RefNannyFinishContext();
7406 }
7407 
7408 /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":821
7409  * ctypedef npy_cdouble complex_t
7410  *
7411  * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<<
7412  * return PyArray_MultiIterNew(1, <void*>a)
7413  *
7414  */
7415 
7416 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__pyx_v_a) {
7417  PyObject *__pyx_r = NULL;
7418  __Pyx_RefNannyDeclarations
7419  PyObject *__pyx_t_1 = NULL;
7420  __Pyx_RefNannySetupContext("PyArray_MultiIterNew1", 0);
7421 
7422  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":822
7423  *
7424  * cdef inline object PyArray_MultiIterNew1(a):
7425  * return PyArray_MultiIterNew(1, <void*>a) # <<<<<<<<<<<<<<
7426  *
7427  * cdef inline object PyArray_MultiIterNew2(a, b):
7428  */
7429  __Pyx_XDECREF(__pyx_r);
7430  __pyx_t_1 = PyArray_MultiIterNew(1, ((void *)__pyx_v_a)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 822, __pyx_L1_error)
7431  __Pyx_GOTREF(__pyx_t_1);
7432  __pyx_r = __pyx_t_1;
7433  __pyx_t_1 = 0;
7434  goto __pyx_L0;
7435 
7436  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":821
7437  * ctypedef npy_cdouble complex_t
7438  *
7439  * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<<
7440  * return PyArray_MultiIterNew(1, <void*>a)
7441  *
7442  */
7443 
7444  /* function exit code */
7445  __pyx_L1_error:;
7446  __Pyx_XDECREF(__pyx_t_1);
7447  __Pyx_AddTraceback("numpy.PyArray_MultiIterNew1", __pyx_clineno, __pyx_lineno, __pyx_filename);
7448  __pyx_r = 0;
7449  __pyx_L0:;
7450  __Pyx_XGIVEREF(__pyx_r);
7451  __Pyx_RefNannyFinishContext();
7452  return __pyx_r;
7453 }
7454 
7455 /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":824
7456  * return PyArray_MultiIterNew(1, <void*>a)
7457  *
7458  * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<<
7459  * return PyArray_MultiIterNew(2, <void*>a, <void*>b)
7460  *
7461  */
7462 
7463 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__pyx_v_a, PyObject *__pyx_v_b) {
7464  PyObject *__pyx_r = NULL;
7465  __Pyx_RefNannyDeclarations
7466  PyObject *__pyx_t_1 = NULL;
7467  __Pyx_RefNannySetupContext("PyArray_MultiIterNew2", 0);
7468 
7469  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":825
7470  *
7471  * cdef inline object PyArray_MultiIterNew2(a, b):
7472  * return PyArray_MultiIterNew(2, <void*>a, <void*>b) # <<<<<<<<<<<<<<
7473  *
7474  * cdef inline object PyArray_MultiIterNew3(a, b, c):
7475  */
7476  __Pyx_XDECREF(__pyx_r);
7477  __pyx_t_1 = PyArray_MultiIterNew(2, ((void *)__pyx_v_a), ((void *)__pyx_v_b)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 825, __pyx_L1_error)
7478  __Pyx_GOTREF(__pyx_t_1);
7479  __pyx_r = __pyx_t_1;
7480  __pyx_t_1 = 0;
7481  goto __pyx_L0;
7482 
7483  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":824
7484  * return PyArray_MultiIterNew(1, <void*>a)
7485  *
7486  * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<<
7487  * return PyArray_MultiIterNew(2, <void*>a, <void*>b)
7488  *
7489  */
7490 
7491  /* function exit code */
7492  __pyx_L1_error:;
7493  __Pyx_XDECREF(__pyx_t_1);
7494  __Pyx_AddTraceback("numpy.PyArray_MultiIterNew2", __pyx_clineno, __pyx_lineno, __pyx_filename);
7495  __pyx_r = 0;
7496  __pyx_L0:;
7497  __Pyx_XGIVEREF(__pyx_r);
7498  __Pyx_RefNannyFinishContext();
7499  return __pyx_r;
7500 }
7501 
7502 /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":827
7503  * return PyArray_MultiIterNew(2, <void*>a, <void*>b)
7504  *
7505  * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<<
7506  * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
7507  *
7508  */
7509 
7510 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c) {
7511  PyObject *__pyx_r = NULL;
7512  __Pyx_RefNannyDeclarations
7513  PyObject *__pyx_t_1 = NULL;
7514  __Pyx_RefNannySetupContext("PyArray_MultiIterNew3", 0);
7515 
7516  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":828
7517  *
7518  * cdef inline object PyArray_MultiIterNew3(a, b, c):
7519  * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c) # <<<<<<<<<<<<<<
7520  *
7521  * cdef inline object PyArray_MultiIterNew4(a, b, c, d):
7522  */
7523  __Pyx_XDECREF(__pyx_r);
7524  __pyx_t_1 = PyArray_MultiIterNew(3, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 828, __pyx_L1_error)
7525  __Pyx_GOTREF(__pyx_t_1);
7526  __pyx_r = __pyx_t_1;
7527  __pyx_t_1 = 0;
7528  goto __pyx_L0;
7529 
7530  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":827
7531  * return PyArray_MultiIterNew(2, <void*>a, <void*>b)
7532  *
7533  * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<<
7534  * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
7535  *
7536  */
7537 
7538  /* function exit code */
7539  __pyx_L1_error:;
7540  __Pyx_XDECREF(__pyx_t_1);
7541  __Pyx_AddTraceback("numpy.PyArray_MultiIterNew3", __pyx_clineno, __pyx_lineno, __pyx_filename);
7542  __pyx_r = 0;
7543  __pyx_L0:;
7544  __Pyx_XGIVEREF(__pyx_r);
7545  __Pyx_RefNannyFinishContext();
7546  return __pyx_r;
7547 }
7548 
7549 /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":830
7550  * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
7551  *
7552  * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<<
7553  * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
7554  *
7555  */
7556 
7557 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c, PyObject *__pyx_v_d) {
7558  PyObject *__pyx_r = NULL;
7559  __Pyx_RefNannyDeclarations
7560  PyObject *__pyx_t_1 = NULL;
7561  __Pyx_RefNannySetupContext("PyArray_MultiIterNew4", 0);
7562 
7563  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":831
7564  *
7565  * cdef inline object PyArray_MultiIterNew4(a, b, c, d):
7566  * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d) # <<<<<<<<<<<<<<
7567  *
7568  * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e):
7569  */
7570  __Pyx_XDECREF(__pyx_r);
7571  __pyx_t_1 = PyArray_MultiIterNew(4, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 831, __pyx_L1_error)
7572  __Pyx_GOTREF(__pyx_t_1);
7573  __pyx_r = __pyx_t_1;
7574  __pyx_t_1 = 0;
7575  goto __pyx_L0;
7576 
7577  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":830
7578  * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
7579  *
7580  * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<<
7581  * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
7582  *
7583  */
7584 
7585  /* function exit code */
7586  __pyx_L1_error:;
7587  __Pyx_XDECREF(__pyx_t_1);
7588  __Pyx_AddTraceback("numpy.PyArray_MultiIterNew4", __pyx_clineno, __pyx_lineno, __pyx_filename);
7589  __pyx_r = 0;
7590  __pyx_L0:;
7591  __Pyx_XGIVEREF(__pyx_r);
7592  __Pyx_RefNannyFinishContext();
7593  return __pyx_r;
7594 }
7595 
7596 /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":833
7597  * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
7598  *
7599  * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<<
7600  * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
7601  *
7602  */
7603 
7604 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c, PyObject *__pyx_v_d, PyObject *__pyx_v_e) {
7605  PyObject *__pyx_r = NULL;
7606  __Pyx_RefNannyDeclarations
7607  PyObject *__pyx_t_1 = NULL;
7608  __Pyx_RefNannySetupContext("PyArray_MultiIterNew5", 0);
7609 
7610  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":834
7611  *
7612  * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e):
7613  * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e) # <<<<<<<<<<<<<<
7614  *
7615  * cdef inline tuple PyDataType_SHAPE(dtype d):
7616  */
7617  __Pyx_XDECREF(__pyx_r);
7618  __pyx_t_1 = PyArray_MultiIterNew(5, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d), ((void *)__pyx_v_e)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 834, __pyx_L1_error)
7619  __Pyx_GOTREF(__pyx_t_1);
7620  __pyx_r = __pyx_t_1;
7621  __pyx_t_1 = 0;
7622  goto __pyx_L0;
7623 
7624  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":833
7625  * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
7626  *
7627  * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<<
7628  * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
7629  *
7630  */
7631 
7632  /* function exit code */
7633  __pyx_L1_error:;
7634  __Pyx_XDECREF(__pyx_t_1);
7635  __Pyx_AddTraceback("numpy.PyArray_MultiIterNew5", __pyx_clineno, __pyx_lineno, __pyx_filename);
7636  __pyx_r = 0;
7637  __pyx_L0:;
7638  __Pyx_XGIVEREF(__pyx_r);
7639  __Pyx_RefNannyFinishContext();
7640  return __pyx_r;
7641 }
7642 
7643 /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":836
7644  * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
7645  *
7646  * cdef inline tuple PyDataType_SHAPE(dtype d): # <<<<<<<<<<<<<<
7647  * if PyDataType_HASSUBARRAY(d):
7648  * return <tuple>d.subarray.shape
7649  */
7650 
7651 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__pyx_v_d) {
7652  PyObject *__pyx_r = NULL;
7653  __Pyx_RefNannyDeclarations
7654  int __pyx_t_1;
7655  __Pyx_RefNannySetupContext("PyDataType_SHAPE", 0);
7656 
7657  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":837
7658  *
7659  * cdef inline tuple PyDataType_SHAPE(dtype d):
7660  * if PyDataType_HASSUBARRAY(d): # <<<<<<<<<<<<<<
7661  * return <tuple>d.subarray.shape
7662  * else:
7663  */
7664  __pyx_t_1 = (PyDataType_HASSUBARRAY(__pyx_v_d) != 0);
7665  if (__pyx_t_1) {
7666 
7667  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":838
7668  * cdef inline tuple PyDataType_SHAPE(dtype d):
7669  * if PyDataType_HASSUBARRAY(d):
7670  * return <tuple>d.subarray.shape # <<<<<<<<<<<<<<
7671  * else:
7672  * return ()
7673  */
7674  __Pyx_XDECREF(__pyx_r);
7675  __Pyx_INCREF(((PyObject*)__pyx_v_d->subarray->shape));
7676  __pyx_r = ((PyObject*)__pyx_v_d->subarray->shape);
7677  goto __pyx_L0;
7678 
7679  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":837
7680  *
7681  * cdef inline tuple PyDataType_SHAPE(dtype d):
7682  * if PyDataType_HASSUBARRAY(d): # <<<<<<<<<<<<<<
7683  * return <tuple>d.subarray.shape
7684  * else:
7685  */
7686  }
7687 
7688  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":840
7689  * return <tuple>d.subarray.shape
7690  * else:
7691  * return () # <<<<<<<<<<<<<<
7692  *
7693  * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL:
7694  */
7695  /*else*/ {
7696  __Pyx_XDECREF(__pyx_r);
7697  __Pyx_INCREF(__pyx_empty_tuple);
7698  __pyx_r = __pyx_empty_tuple;
7699  goto __pyx_L0;
7700  }
7701 
7702  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":836
7703  * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
7704  *
7705  * cdef inline tuple PyDataType_SHAPE(dtype d): # <<<<<<<<<<<<<<
7706  * if PyDataType_HASSUBARRAY(d):
7707  * return <tuple>d.subarray.shape
7708  */
7709 
7710  /* function exit code */
7711  __pyx_L0:;
7712  __Pyx_XGIVEREF(__pyx_r);
7713  __Pyx_RefNannyFinishContext();
7714  return __pyx_r;
7715 }
7716 
7717 /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":842
7718  * return ()
7719  *
7720  * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL: # <<<<<<<<<<<<<<
7721  * # Recursive utility function used in __getbuffer__ to get format
7722  * # string. The new location in the format string is returned.
7723  */
7724 
7725 static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx_v_descr, char *__pyx_v_f, char *__pyx_v_end, int *__pyx_v_offset) {
7726  PyArray_Descr *__pyx_v_child = 0;
7727  int __pyx_v_endian_detector;
7728  int __pyx_v_little_endian;
7729  PyObject *__pyx_v_fields = 0;
7730  PyObject *__pyx_v_childname = NULL;
7731  PyObject *__pyx_v_new_offset = NULL;
7732  PyObject *__pyx_v_t = NULL;
7733  char *__pyx_r;
7734  __Pyx_RefNannyDeclarations
7735  PyObject *__pyx_t_1 = NULL;
7736  Py_ssize_t __pyx_t_2;
7737  PyObject *__pyx_t_3 = NULL;
7738  PyObject *__pyx_t_4 = NULL;
7739  int __pyx_t_5;
7740  int __pyx_t_6;
7741  int __pyx_t_7;
7742  long __pyx_t_8;
7743  char *__pyx_t_9;
7744  __Pyx_RefNannySetupContext("_util_dtypestring", 0);
7745 
7746  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":847
7747  *
7748  * cdef dtype child
7749  * cdef int endian_detector = 1 # <<<<<<<<<<<<<<
7750  * cdef bint little_endian = ((<char*>&endian_detector)[0] != 0)
7751  * cdef tuple fields
7752  */
7753  __pyx_v_endian_detector = 1;
7754 
7755  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":848
7756  * cdef dtype child
7757  * cdef int endian_detector = 1
7758  * cdef bint little_endian = ((<char*>&endian_detector)[0] != 0) # <<<<<<<<<<<<<<
7759  * cdef tuple fields
7760  *
7761  */
7762  __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0);
7763 
7764  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":851
7765  * cdef tuple fields
7766  *
7767  * for childname in descr.names: # <<<<<<<<<<<<<<
7768  * fields = descr.fields[childname]
7769  * child, new_offset = fields
7770  */
7771  if (unlikely(__pyx_v_descr->names == Py_None)) {
7772  PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
7773  __PYX_ERR(1, 851, __pyx_L1_error)
7774  }
7775  __pyx_t_1 = __pyx_v_descr->names; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
7776  for (;;) {
7777  if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
7778  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
7779  __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(1, 851, __pyx_L1_error)
7780  #else
7781  __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 851, __pyx_L1_error)
7782  __Pyx_GOTREF(__pyx_t_3);
7783  #endif
7784  __Pyx_XDECREF_SET(__pyx_v_childname, __pyx_t_3);
7785  __pyx_t_3 = 0;
7786 
7787  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":852
7788  *
7789  * for childname in descr.names:
7790  * fields = descr.fields[childname] # <<<<<<<<<<<<<<
7791  * child, new_offset = fields
7792  *
7793  */
7794  if (unlikely(__pyx_v_descr->fields == Py_None)) {
7795  PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
7796  __PYX_ERR(1, 852, __pyx_L1_error)
7797  }
7798  __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_descr->fields, __pyx_v_childname); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 852, __pyx_L1_error)
7799  __Pyx_GOTREF(__pyx_t_3);
7800  if (!(likely(PyTuple_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_3)->tp_name), 0))) __PYX_ERR(1, 852, __pyx_L1_error)
7801  __Pyx_XDECREF_SET(__pyx_v_fields, ((PyObject*)__pyx_t_3));
7802  __pyx_t_3 = 0;
7803 
7804  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":853
7805  * for childname in descr.names:
7806  * fields = descr.fields[childname]
7807  * child, new_offset = fields # <<<<<<<<<<<<<<
7808  *
7809  * if (end - f) - <int>(new_offset - offset[0]) < 15:
7810  */
7811  if (likely(__pyx_v_fields != Py_None)) {
7812  PyObject* sequence = __pyx_v_fields;
7813  Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
7814  if (unlikely(size != 2)) {
7815  if (size > 2) __Pyx_RaiseTooManyValuesError(2);
7816  else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
7817  __PYX_ERR(1, 853, __pyx_L1_error)
7818  }
7819  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
7820  __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0);
7821  __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1);
7822  __Pyx_INCREF(__pyx_t_3);
7823  __Pyx_INCREF(__pyx_t_4);
7824  #else
7825  __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 853, __pyx_L1_error)
7826  __Pyx_GOTREF(__pyx_t_3);
7827  __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 853, __pyx_L1_error)
7828  __Pyx_GOTREF(__pyx_t_4);
7829  #endif
7830  } else {
7831  __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(1, 853, __pyx_L1_error)
7832  }
7833  if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_dtype))))) __PYX_ERR(1, 853, __pyx_L1_error)
7834  __Pyx_XDECREF_SET(__pyx_v_child, ((PyArray_Descr *)__pyx_t_3));
7835  __pyx_t_3 = 0;
7836  __Pyx_XDECREF_SET(__pyx_v_new_offset, __pyx_t_4);
7837  __pyx_t_4 = 0;
7838 
7839  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":855
7840  * child, new_offset = fields
7841  *
7842  * if (end - f) - <int>(new_offset - offset[0]) < 15: # <<<<<<<<<<<<<<
7843  * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")
7844  *
7845  */
7846  __pyx_t_4 = __Pyx_PyInt_From_int((__pyx_v_offset[0])); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 855, __pyx_L1_error)
7847  __Pyx_GOTREF(__pyx_t_4);
7848  __pyx_t_3 = PyNumber_Subtract(__pyx_v_new_offset, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 855, __pyx_L1_error)
7849  __Pyx_GOTREF(__pyx_t_3);
7850  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7851  __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 855, __pyx_L1_error)
7852  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7853  __pyx_t_6 = ((((__pyx_v_end - __pyx_v_f) - ((int)__pyx_t_5)) < 15) != 0);
7854  if (unlikely(__pyx_t_6)) {
7855 
7856  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":856
7857  *
7858  * if (end - f) - <int>(new_offset - offset[0]) < 15:
7859  * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") # <<<<<<<<<<<<<<
7860  *
7861  * if ((child.byteorder == c'>' and little_endian) or
7862  */
7863  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 856, __pyx_L1_error)
7864  __Pyx_GOTREF(__pyx_t_3);
7865  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
7866  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7867  __PYX_ERR(1, 856, __pyx_L1_error)
7868 
7869  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":855
7870  * child, new_offset = fields
7871  *
7872  * if (end - f) - <int>(new_offset - offset[0]) < 15: # <<<<<<<<<<<<<<
7873  * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")
7874  *
7875  */
7876  }
7877 
7878  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":858
7879  * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")
7880  *
7881  * if ((child.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<<
7882  * (child.byteorder == c'<' and not little_endian)):
7883  * raise ValueError(u"Non-native byte order not supported")
7884  */
7885  __pyx_t_7 = ((__pyx_v_child->byteorder == '>') != 0);
7886  if (!__pyx_t_7) {
7887  goto __pyx_L8_next_or;
7888  } else {
7889  }
7890  __pyx_t_7 = (__pyx_v_little_endian != 0);
7891  if (!__pyx_t_7) {
7892  } else {
7893  __pyx_t_6 = __pyx_t_7;
7894  goto __pyx_L7_bool_binop_done;
7895  }
7896  __pyx_L8_next_or:;
7897 
7898  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":859
7899  *
7900  * if ((child.byteorder == c'>' and little_endian) or
7901  * (child.byteorder == c'<' and not little_endian)): # <<<<<<<<<<<<<<
7902  * raise ValueError(u"Non-native byte order not supported")
7903  * # One could encode it in the format string and have Cython
7904  */
7905  __pyx_t_7 = ((__pyx_v_child->byteorder == '<') != 0);
7906  if (__pyx_t_7) {
7907  } else {
7908  __pyx_t_6 = __pyx_t_7;
7909  goto __pyx_L7_bool_binop_done;
7910  }
7911  __pyx_t_7 = ((!(__pyx_v_little_endian != 0)) != 0);
7912  __pyx_t_6 = __pyx_t_7;
7913  __pyx_L7_bool_binop_done:;
7914 
7915  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":858
7916  * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")
7917  *
7918  * if ((child.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<<
7919  * (child.byteorder == c'<' and not little_endian)):
7920  * raise ValueError(u"Non-native byte order not supported")
7921  */
7922  if (unlikely(__pyx_t_6)) {
7923 
7924  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":860
7925  * if ((child.byteorder == c'>' and little_endian) or
7926  * (child.byteorder == c'<' and not little_endian)):
7927  * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<<
7928  * # One could encode it in the format string and have Cython
7929  * # complain instead, BUT: < and > in format strings also imply
7930  */
7931  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 860, __pyx_L1_error)
7932  __Pyx_GOTREF(__pyx_t_3);
7933  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
7934  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7935  __PYX_ERR(1, 860, __pyx_L1_error)
7936 
7937  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":858
7938  * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")
7939  *
7940  * if ((child.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<<
7941  * (child.byteorder == c'<' and not little_endian)):
7942  * raise ValueError(u"Non-native byte order not supported")
7943  */
7944  }
7945 
7946  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":870
7947  *
7948  * # Output padding bytes
7949  * while offset[0] < new_offset: # <<<<<<<<<<<<<<
7950  * f[0] = 120 # "x"; pad byte
7951  * f += 1
7952  */
7953  while (1) {
7954  __pyx_t_3 = __Pyx_PyInt_From_int((__pyx_v_offset[0])); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 870, __pyx_L1_error)
7955  __Pyx_GOTREF(__pyx_t_3);
7956  __pyx_t_4 = PyObject_RichCompare(__pyx_t_3, __pyx_v_new_offset, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 870, __pyx_L1_error)
7957  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7958  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 870, __pyx_L1_error)
7959  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7960  if (!__pyx_t_6) break;
7961 
7962  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":871
7963  * # Output padding bytes
7964  * while offset[0] < new_offset:
7965  * f[0] = 120 # "x"; pad byte # <<<<<<<<<<<<<<
7966  * f += 1
7967  * offset[0] += 1
7968  */
7969  (__pyx_v_f[0]) = 0x78;
7970 
7971  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":872
7972  * while offset[0] < new_offset:
7973  * f[0] = 120 # "x"; pad byte
7974  * f += 1 # <<<<<<<<<<<<<<
7975  * offset[0] += 1
7976  *
7977  */
7978  __pyx_v_f = (__pyx_v_f + 1);
7979 
7980  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":873
7981  * f[0] = 120 # "x"; pad byte
7982  * f += 1
7983  * offset[0] += 1 # <<<<<<<<<<<<<<
7984  *
7985  * offset[0] += child.itemsize
7986  */
7987  __pyx_t_8 = 0;
7988  (__pyx_v_offset[__pyx_t_8]) = ((__pyx_v_offset[__pyx_t_8]) + 1);
7989  }
7990 
7991  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":875
7992  * offset[0] += 1
7993  *
7994  * offset[0] += child.itemsize # <<<<<<<<<<<<<<
7995  *
7996  * if not PyDataType_HASFIELDS(child):
7997  */
7998  __pyx_t_8 = 0;
7999  (__pyx_v_offset[__pyx_t_8]) = ((__pyx_v_offset[__pyx_t_8]) + __pyx_v_child->elsize);
8000 
8001  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":877
8002  * offset[0] += child.itemsize
8003  *
8004  * if not PyDataType_HASFIELDS(child): # <<<<<<<<<<<<<<
8005  * t = child.type_num
8006  * if end - f < 5:
8007  */
8008  __pyx_t_6 = ((!(PyDataType_HASFIELDS(__pyx_v_child) != 0)) != 0);
8009  if (__pyx_t_6) {
8010 
8011  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":878
8012  *
8013  * if not PyDataType_HASFIELDS(child):
8014  * t = child.type_num # <<<<<<<<<<<<<<
8015  * if end - f < 5:
8016  * raise RuntimeError(u"Format string allocated too short.")
8017  */
8018  __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_child->type_num); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 878, __pyx_L1_error)
8019  __Pyx_GOTREF(__pyx_t_4);
8020  __Pyx_XDECREF_SET(__pyx_v_t, __pyx_t_4);
8021  __pyx_t_4 = 0;
8022 
8023  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":879
8024  * if not PyDataType_HASFIELDS(child):
8025  * t = child.type_num
8026  * if end - f < 5: # <<<<<<<<<<<<<<
8027  * raise RuntimeError(u"Format string allocated too short.")
8028  *
8029  */
8030  __pyx_t_6 = (((__pyx_v_end - __pyx_v_f) < 5) != 0);
8031  if (unlikely(__pyx_t_6)) {
8032 
8033  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":880
8034  * t = child.type_num
8035  * if end - f < 5:
8036  * raise RuntimeError(u"Format string allocated too short.") # <<<<<<<<<<<<<<
8037  *
8038  * # Until ticket #99 is fixed, use integers to avoid warnings
8039  */
8040  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 880, __pyx_L1_error)
8041  __Pyx_GOTREF(__pyx_t_4);
8042  __Pyx_Raise(__pyx_t_4, 0, 0, 0);
8043  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8044  __PYX_ERR(1, 880, __pyx_L1_error)
8045 
8046  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":879
8047  * if not PyDataType_HASFIELDS(child):
8048  * t = child.type_num
8049  * if end - f < 5: # <<<<<<<<<<<<<<
8050  * raise RuntimeError(u"Format string allocated too short.")
8051  *
8052  */
8053  }
8054 
8055  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":883
8056  *
8057  * # Until ticket #99 is fixed, use integers to avoid warnings
8058  * if t == NPY_BYTE: f[0] = 98 #"b" # <<<<<<<<<<<<<<
8059  * elif t == NPY_UBYTE: f[0] = 66 #"B"
8060  * elif t == NPY_SHORT: f[0] = 104 #"h"
8061  */
8062  __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_BYTE); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 883, __pyx_L1_error)
8063  __Pyx_GOTREF(__pyx_t_4);
8064  __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 883, __pyx_L1_error)
8065  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8066  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 883, __pyx_L1_error)
8067  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8068  if (__pyx_t_6) {
8069  (__pyx_v_f[0]) = 98;
8070  goto __pyx_L15;
8071  }
8072 
8073  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":884
8074  * # Until ticket #99 is fixed, use integers to avoid warnings
8075  * if t == NPY_BYTE: f[0] = 98 #"b"
8076  * elif t == NPY_UBYTE: f[0] = 66 #"B" # <<<<<<<<<<<<<<
8077  * elif t == NPY_SHORT: f[0] = 104 #"h"
8078  * elif t == NPY_USHORT: f[0] = 72 #"H"
8079  */
8080  __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_UBYTE); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 884, __pyx_L1_error)
8081  __Pyx_GOTREF(__pyx_t_3);
8082  __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 884, __pyx_L1_error)
8083  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8084  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 884, __pyx_L1_error)
8085  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8086  if (__pyx_t_6) {
8087  (__pyx_v_f[0]) = 66;
8088  goto __pyx_L15;
8089  }
8090 
8091  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":885
8092  * if t == NPY_BYTE: f[0] = 98 #"b"
8093  * elif t == NPY_UBYTE: f[0] = 66 #"B"
8094  * elif t == NPY_SHORT: f[0] = 104 #"h" # <<<<<<<<<<<<<<
8095  * elif t == NPY_USHORT: f[0] = 72 #"H"
8096  * elif t == NPY_INT: f[0] = 105 #"i"
8097  */
8098  __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_SHORT); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 885, __pyx_L1_error)
8099  __Pyx_GOTREF(__pyx_t_4);
8100  __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 885, __pyx_L1_error)
8101  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8102  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 885, __pyx_L1_error)
8103  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8104  if (__pyx_t_6) {
8105  (__pyx_v_f[0]) = 0x68;
8106  goto __pyx_L15;
8107  }
8108 
8109  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":886
8110  * elif t == NPY_UBYTE: f[0] = 66 #"B"
8111  * elif t == NPY_SHORT: f[0] = 104 #"h"
8112  * elif t == NPY_USHORT: f[0] = 72 #"H" # <<<<<<<<<<<<<<
8113  * elif t == NPY_INT: f[0] = 105 #"i"
8114  * elif t == NPY_UINT: f[0] = 73 #"I"
8115  */
8116  __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_USHORT); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 886, __pyx_L1_error)
8117  __Pyx_GOTREF(__pyx_t_3);
8118  __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 886, __pyx_L1_error)
8119  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8120  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 886, __pyx_L1_error)
8121  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8122  if (__pyx_t_6) {
8123  (__pyx_v_f[0]) = 72;
8124  goto __pyx_L15;
8125  }
8126 
8127  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":887
8128  * elif t == NPY_SHORT: f[0] = 104 #"h"
8129  * elif t == NPY_USHORT: f[0] = 72 #"H"
8130  * elif t == NPY_INT: f[0] = 105 #"i" # <<<<<<<<<<<<<<
8131  * elif t == NPY_UINT: f[0] = 73 #"I"
8132  * elif t == NPY_LONG: f[0] = 108 #"l"
8133  */
8134  __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_INT); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 887, __pyx_L1_error)
8135  __Pyx_GOTREF(__pyx_t_4);
8136  __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 887, __pyx_L1_error)
8137  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8138  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 887, __pyx_L1_error)
8139  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8140  if (__pyx_t_6) {
8141  (__pyx_v_f[0]) = 0x69;
8142  goto __pyx_L15;
8143  }
8144 
8145  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":888
8146  * elif t == NPY_USHORT: f[0] = 72 #"H"
8147  * elif t == NPY_INT: f[0] = 105 #"i"
8148  * elif t == NPY_UINT: f[0] = 73 #"I" # <<<<<<<<<<<<<<
8149  * elif t == NPY_LONG: f[0] = 108 #"l"
8150  * elif t == NPY_ULONG: f[0] = 76 #"L"
8151  */
8152  __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_UINT); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 888, __pyx_L1_error)
8153  __Pyx_GOTREF(__pyx_t_3);
8154  __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 888, __pyx_L1_error)
8155  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8156  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 888, __pyx_L1_error)
8157  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8158  if (__pyx_t_6) {
8159  (__pyx_v_f[0]) = 73;
8160  goto __pyx_L15;
8161  }
8162 
8163  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":889
8164  * elif t == NPY_INT: f[0] = 105 #"i"
8165  * elif t == NPY_UINT: f[0] = 73 #"I"
8166  * elif t == NPY_LONG: f[0] = 108 #"l" # <<<<<<<<<<<<<<
8167  * elif t == NPY_ULONG: f[0] = 76 #"L"
8168  * elif t == NPY_LONGLONG: f[0] = 113 #"q"
8169  */
8170  __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONG); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 889, __pyx_L1_error)
8171  __Pyx_GOTREF(__pyx_t_4);
8172  __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 889, __pyx_L1_error)
8173  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8174  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 889, __pyx_L1_error)
8175  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8176  if (__pyx_t_6) {
8177  (__pyx_v_f[0]) = 0x6C;
8178  goto __pyx_L15;
8179  }
8180 
8181  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":890
8182  * elif t == NPY_UINT: f[0] = 73 #"I"
8183  * elif t == NPY_LONG: f[0] = 108 #"l"
8184  * elif t == NPY_ULONG: f[0] = 76 #"L" # <<<<<<<<<<<<<<
8185  * elif t == NPY_LONGLONG: f[0] = 113 #"q"
8186  * elif t == NPY_ULONGLONG: f[0] = 81 #"Q"
8187  */
8188  __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_ULONG); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 890, __pyx_L1_error)
8189  __Pyx_GOTREF(__pyx_t_3);
8190  __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 890, __pyx_L1_error)
8191  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8192  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 890, __pyx_L1_error)
8193  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8194  if (__pyx_t_6) {
8195  (__pyx_v_f[0]) = 76;
8196  goto __pyx_L15;
8197  }
8198 
8199  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":891
8200  * elif t == NPY_LONG: f[0] = 108 #"l"
8201  * elif t == NPY_ULONG: f[0] = 76 #"L"
8202  * elif t == NPY_LONGLONG: f[0] = 113 #"q" # <<<<<<<<<<<<<<
8203  * elif t == NPY_ULONGLONG: f[0] = 81 #"Q"
8204  * elif t == NPY_FLOAT: f[0] = 102 #"f"
8205  */
8206  __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONGLONG); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 891, __pyx_L1_error)
8207  __Pyx_GOTREF(__pyx_t_4);
8208  __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 891, __pyx_L1_error)
8209  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8210  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 891, __pyx_L1_error)
8211  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8212  if (__pyx_t_6) {
8213  (__pyx_v_f[0]) = 0x71;
8214  goto __pyx_L15;
8215  }
8216 
8217  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":892
8218  * elif t == NPY_ULONG: f[0] = 76 #"L"
8219  * elif t == NPY_LONGLONG: f[0] = 113 #"q"
8220  * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" # <<<<<<<<<<<<<<
8221  * elif t == NPY_FLOAT: f[0] = 102 #"f"
8222  * elif t == NPY_DOUBLE: f[0] = 100 #"d"
8223  */
8224  __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_ULONGLONG); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 892, __pyx_L1_error)
8225  __Pyx_GOTREF(__pyx_t_3);
8226  __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 892, __pyx_L1_error)
8227  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8228  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 892, __pyx_L1_error)
8229  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8230  if (__pyx_t_6) {
8231  (__pyx_v_f[0]) = 81;
8232  goto __pyx_L15;
8233  }
8234 
8235  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":893
8236  * elif t == NPY_LONGLONG: f[0] = 113 #"q"
8237  * elif t == NPY_ULONGLONG: f[0] = 81 #"Q"
8238  * elif t == NPY_FLOAT: f[0] = 102 #"f" # <<<<<<<<<<<<<<
8239  * elif t == NPY_DOUBLE: f[0] = 100 #"d"
8240  * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g"
8241  */
8242  __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_FLOAT); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 893, __pyx_L1_error)
8243  __Pyx_GOTREF(__pyx_t_4);
8244  __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 893, __pyx_L1_error)
8245  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8246  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 893, __pyx_L1_error)
8247  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8248  if (__pyx_t_6) {
8249  (__pyx_v_f[0]) = 0x66;
8250  goto __pyx_L15;
8251  }
8252 
8253  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":894
8254  * elif t == NPY_ULONGLONG: f[0] = 81 #"Q"
8255  * elif t == NPY_FLOAT: f[0] = 102 #"f"
8256  * elif t == NPY_DOUBLE: f[0] = 100 #"d" # <<<<<<<<<<<<<<
8257  * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g"
8258  * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf
8259  */
8260  __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_DOUBLE); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 894, __pyx_L1_error)
8261  __Pyx_GOTREF(__pyx_t_3);
8262  __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 894, __pyx_L1_error)
8263  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8264  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 894, __pyx_L1_error)
8265  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8266  if (__pyx_t_6) {
8267  (__pyx_v_f[0]) = 0x64;
8268  goto __pyx_L15;
8269  }
8270 
8271  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":895
8272  * elif t == NPY_FLOAT: f[0] = 102 #"f"
8273  * elif t == NPY_DOUBLE: f[0] = 100 #"d"
8274  * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" # <<<<<<<<<<<<<<
8275  * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf
8276  * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd
8277  */
8278  __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONGDOUBLE); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 895, __pyx_L1_error)
8279  __Pyx_GOTREF(__pyx_t_4);
8280  __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 895, __pyx_L1_error)
8281  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8282  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 895, __pyx_L1_error)
8283  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8284  if (__pyx_t_6) {
8285  (__pyx_v_f[0]) = 0x67;
8286  goto __pyx_L15;
8287  }
8288 
8289  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":896
8290  * elif t == NPY_DOUBLE: f[0] = 100 #"d"
8291  * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g"
8292  * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf # <<<<<<<<<<<<<<
8293  * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd
8294  * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg
8295  */
8296  __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CFLOAT); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 896, __pyx_L1_error)
8297  __Pyx_GOTREF(__pyx_t_3);
8298  __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 896, __pyx_L1_error)
8299  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8300  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 896, __pyx_L1_error)
8301  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8302  if (__pyx_t_6) {
8303  (__pyx_v_f[0]) = 90;
8304  (__pyx_v_f[1]) = 0x66;
8305  __pyx_v_f = (__pyx_v_f + 1);
8306  goto __pyx_L15;
8307  }
8308 
8309  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":897
8310  * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g"
8311  * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf
8312  * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd # <<<<<<<<<<<<<<
8313  * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg
8314  * elif t == NPY_OBJECT: f[0] = 79 #"O"
8315  */
8316  __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CDOUBLE); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 897, __pyx_L1_error)
8317  __Pyx_GOTREF(__pyx_t_4);
8318  __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 897, __pyx_L1_error)
8319  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8320  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 897, __pyx_L1_error)
8321  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8322  if (__pyx_t_6) {
8323  (__pyx_v_f[0]) = 90;
8324  (__pyx_v_f[1]) = 0x64;
8325  __pyx_v_f = (__pyx_v_f + 1);
8326  goto __pyx_L15;
8327  }
8328 
8329  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":898
8330  * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf
8331  * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd
8332  * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg # <<<<<<<<<<<<<<
8333  * elif t == NPY_OBJECT: f[0] = 79 #"O"
8334  * else:
8335  */
8336  __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CLONGDOUBLE); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 898, __pyx_L1_error)
8337  __Pyx_GOTREF(__pyx_t_3);
8338  __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 898, __pyx_L1_error)
8339  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8340  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 898, __pyx_L1_error)
8341  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8342  if (__pyx_t_6) {
8343  (__pyx_v_f[0]) = 90;
8344  (__pyx_v_f[1]) = 0x67;
8345  __pyx_v_f = (__pyx_v_f + 1);
8346  goto __pyx_L15;
8347  }
8348 
8349  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":899
8350  * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd
8351  * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg
8352  * elif t == NPY_OBJECT: f[0] = 79 #"O" # <<<<<<<<<<<<<<
8353  * else:
8354  * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
8355  */
8356  __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_OBJECT); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 899, __pyx_L1_error)
8357  __Pyx_GOTREF(__pyx_t_4);
8358  __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 899, __pyx_L1_error)
8359  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8360  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 899, __pyx_L1_error)
8361  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8362  if (likely(__pyx_t_6)) {
8363  (__pyx_v_f[0]) = 79;
8364  goto __pyx_L15;
8365  }
8366 
8367  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":901
8368  * elif t == NPY_OBJECT: f[0] = 79 #"O"
8369  * else:
8370  * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) # <<<<<<<<<<<<<<
8371  * f += 1
8372  * else:
8373  */
8374  /*else*/ {
8375  __pyx_t_3 = __Pyx_PyUnicode_FormatSafe(__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_v_t); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 901, __pyx_L1_error)
8376  __Pyx_GOTREF(__pyx_t_3);
8377  __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 901, __pyx_L1_error)
8378  __Pyx_GOTREF(__pyx_t_4);
8379  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8380  __Pyx_Raise(__pyx_t_4, 0, 0, 0);
8381  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8382  __PYX_ERR(1, 901, __pyx_L1_error)
8383  }
8384  __pyx_L15:;
8385 
8386  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":902
8387  * else:
8388  * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
8389  * f += 1 # <<<<<<<<<<<<<<
8390  * else:
8391  * # Cython ignores struct boundary information ("T{...}"),
8392  */
8393  __pyx_v_f = (__pyx_v_f + 1);
8394 
8395  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":877
8396  * offset[0] += child.itemsize
8397  *
8398  * if not PyDataType_HASFIELDS(child): # <<<<<<<<<<<<<<
8399  * t = child.type_num
8400  * if end - f < 5:
8401  */
8402  goto __pyx_L13;
8403  }
8404 
8405  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":906
8406  * # Cython ignores struct boundary information ("T{...}"),
8407  * # so don't output it
8408  * f = _util_dtypestring(child, f, end, offset) # <<<<<<<<<<<<<<
8409  * return f
8410  *
8411  */
8412  /*else*/ {
8413  __pyx_t_9 = __pyx_f_5numpy__util_dtypestring(__pyx_v_child, __pyx_v_f, __pyx_v_end, __pyx_v_offset); if (unlikely(__pyx_t_9 == ((char *)NULL))) __PYX_ERR(1, 906, __pyx_L1_error)
8414  __pyx_v_f = __pyx_t_9;
8415  }
8416  __pyx_L13:;
8417 
8418  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":851
8419  * cdef tuple fields
8420  *
8421  * for childname in descr.names: # <<<<<<<<<<<<<<
8422  * fields = descr.fields[childname]
8423  * child, new_offset = fields
8424  */
8425  }
8426  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8427 
8428  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":907
8429  * # so don't output it
8430  * f = _util_dtypestring(child, f, end, offset)
8431  * return f # <<<<<<<<<<<<<<
8432  *
8433  *
8434  */
8435  __pyx_r = __pyx_v_f;
8436  goto __pyx_L0;
8437 
8438  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":842
8439  * return ()
8440  *
8441  * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL: # <<<<<<<<<<<<<<
8442  * # Recursive utility function used in __getbuffer__ to get format
8443  * # string. The new location in the format string is returned.
8444  */
8445 
8446  /* function exit code */
8447  __pyx_L1_error:;
8448  __Pyx_XDECREF(__pyx_t_1);
8449  __Pyx_XDECREF(__pyx_t_3);
8450  __Pyx_XDECREF(__pyx_t_4);
8451  __Pyx_AddTraceback("numpy._util_dtypestring", __pyx_clineno, __pyx_lineno, __pyx_filename);
8452  __pyx_r = NULL;
8453  __pyx_L0:;
8454  __Pyx_XDECREF((PyObject *)__pyx_v_child);
8455  __Pyx_XDECREF(__pyx_v_fields);
8456  __Pyx_XDECREF(__pyx_v_childname);
8457  __Pyx_XDECREF(__pyx_v_new_offset);
8458  __Pyx_XDECREF(__pyx_v_t);
8459  __Pyx_RefNannyFinishContext();
8460  return __pyx_r;
8461 }
8462 
8463 /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1022
8464  * int _import_umath() except -1
8465  *
8466  * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<<
8467  * Py_INCREF(base) # important to do this before stealing the reference below!
8468  * PyArray_SetBaseObject(arr, base)
8469  */
8470 
8471 static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_base) {
8472  __Pyx_RefNannyDeclarations
8473  __Pyx_RefNannySetupContext("set_array_base", 0);
8474 
8475  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1023
8476  *
8477  * cdef inline void set_array_base(ndarray arr, object base):
8478  * Py_INCREF(base) # important to do this before stealing the reference below! # <<<<<<<<<<<<<<
8479  * PyArray_SetBaseObject(arr, base)
8480  *
8481  */
8482  Py_INCREF(__pyx_v_base);
8483 
8484  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1024
8485  * cdef inline void set_array_base(ndarray arr, object base):
8486  * Py_INCREF(base) # important to do this before stealing the reference below!
8487  * PyArray_SetBaseObject(arr, base) # <<<<<<<<<<<<<<
8488  *
8489  * cdef inline object get_array_base(ndarray arr):
8490  */
8491  (void)(PyArray_SetBaseObject(__pyx_v_arr, __pyx_v_base));
8492 
8493  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1022
8494  * int _import_umath() except -1
8495  *
8496  * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<<
8497  * Py_INCREF(base) # important to do this before stealing the reference below!
8498  * PyArray_SetBaseObject(arr, base)
8499  */
8500 
8501  /* function exit code */
8502  __Pyx_RefNannyFinishContext();
8503 }
8504 
8505 /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1026
8506  * PyArray_SetBaseObject(arr, base)
8507  *
8508  * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<<
8509  * base = PyArray_BASE(arr)
8510  * if base is NULL:
8511  */
8512 
8513 static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__pyx_v_arr) {
8514  PyObject *__pyx_v_base;
8515  PyObject *__pyx_r = NULL;
8516  __Pyx_RefNannyDeclarations
8517  int __pyx_t_1;
8518  __Pyx_RefNannySetupContext("get_array_base", 0);
8519 
8520  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1027
8521  *
8522  * cdef inline object get_array_base(ndarray arr):
8523  * base = PyArray_BASE(arr) # <<<<<<<<<<<<<<
8524  * if base is NULL:
8525  * return None
8526  */
8527  __pyx_v_base = PyArray_BASE(__pyx_v_arr);
8528 
8529  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1028
8530  * cdef inline object get_array_base(ndarray arr):
8531  * base = PyArray_BASE(arr)
8532  * if base is NULL: # <<<<<<<<<<<<<<
8533  * return None
8534  * return <object>base
8535  */
8536  __pyx_t_1 = ((__pyx_v_base == NULL) != 0);
8537  if (__pyx_t_1) {
8538 
8539  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1029
8540  * base = PyArray_BASE(arr)
8541  * if base is NULL:
8542  * return None # <<<<<<<<<<<<<<
8543  * return <object>base
8544  *
8545  */
8546  __Pyx_XDECREF(__pyx_r);
8547  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
8548  goto __pyx_L0;
8549 
8550  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1028
8551  * cdef inline object get_array_base(ndarray arr):
8552  * base = PyArray_BASE(arr)
8553  * if base is NULL: # <<<<<<<<<<<<<<
8554  * return None
8555  * return <object>base
8556  */
8557  }
8558 
8559  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1030
8560  * if base is NULL:
8561  * return None
8562  * return <object>base # <<<<<<<<<<<<<<
8563  *
8564  * # Versions of the import_* functions which are more suitable for
8565  */
8566  __Pyx_XDECREF(__pyx_r);
8567  __Pyx_INCREF(((PyObject *)__pyx_v_base));
8568  __pyx_r = ((PyObject *)__pyx_v_base);
8569  goto __pyx_L0;
8570 
8571  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1026
8572  * PyArray_SetBaseObject(arr, base)
8573  *
8574  * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<<
8575  * base = PyArray_BASE(arr)
8576  * if base is NULL:
8577  */
8578 
8579  /* function exit code */
8580  __pyx_L0:;
8581  __Pyx_XGIVEREF(__pyx_r);
8582  __Pyx_RefNannyFinishContext();
8583  return __pyx_r;
8584 }
8585 
8586 /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1034
8587  * # Versions of the import_* functions which are more suitable for
8588  * # Cython code.
8589  * cdef inline int import_array() except -1: # <<<<<<<<<<<<<<
8590  * try:
8591  * _import_array()
8592  */
8593 
8594 static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) {
8595  int __pyx_r;
8596  __Pyx_RefNannyDeclarations
8597  PyObject *__pyx_t_1 = NULL;
8598  PyObject *__pyx_t_2 = NULL;
8599  PyObject *__pyx_t_3 = NULL;
8600  int __pyx_t_4;
8601  PyObject *__pyx_t_5 = NULL;
8602  PyObject *__pyx_t_6 = NULL;
8603  PyObject *__pyx_t_7 = NULL;
8604  PyObject *__pyx_t_8 = NULL;
8605  __Pyx_RefNannySetupContext("import_array", 0);
8606 
8607  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1035
8608  * # Cython code.
8609  * cdef inline int import_array() except -1:
8610  * try: # <<<<<<<<<<<<<<
8611  * _import_array()
8612  * except Exception:
8613  */
8614  {
8615  __Pyx_PyThreadState_declare
8616  __Pyx_PyThreadState_assign
8617  __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
8618  __Pyx_XGOTREF(__pyx_t_1);
8619  __Pyx_XGOTREF(__pyx_t_2);
8620  __Pyx_XGOTREF(__pyx_t_3);
8621  /*try:*/ {
8622 
8623  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1036
8624  * cdef inline int import_array() except -1:
8625  * try:
8626  * _import_array() # <<<<<<<<<<<<<<
8627  * except Exception:
8628  * raise ImportError("numpy.core.multiarray failed to import")
8629  */
8630  __pyx_t_4 = _import_array(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 1036, __pyx_L3_error)
8631 
8632  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1035
8633  * # Cython code.
8634  * cdef inline int import_array() except -1:
8635  * try: # <<<<<<<<<<<<<<
8636  * _import_array()
8637  * except Exception:
8638  */
8639  }
8640  __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
8641  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
8642  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
8643  goto __pyx_L8_try_end;
8644  __pyx_L3_error:;
8645 
8646  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1037
8647  * try:
8648  * _import_array()
8649  * except Exception: # <<<<<<<<<<<<<<
8650  * raise ImportError("numpy.core.multiarray failed to import")
8651  *
8652  */
8653  __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
8654  if (__pyx_t_4) {
8655  __Pyx_AddTraceback("numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
8656  if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(1, 1037, __pyx_L5_except_error)
8657  __Pyx_GOTREF(__pyx_t_5);
8658  __Pyx_GOTREF(__pyx_t_6);
8659  __Pyx_GOTREF(__pyx_t_7);
8660 
8661  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1038
8662  * _import_array()
8663  * except Exception:
8664  * raise ImportError("numpy.core.multiarray failed to import") # <<<<<<<<<<<<<<
8665  *
8666  * cdef inline int import_umath() except -1:
8667  */
8668  __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__6, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 1038, __pyx_L5_except_error)
8669  __Pyx_GOTREF(__pyx_t_8);
8670  __Pyx_Raise(__pyx_t_8, 0, 0, 0);
8671  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
8672  __PYX_ERR(1, 1038, __pyx_L5_except_error)
8673  }
8674  goto __pyx_L5_except_error;
8675  __pyx_L5_except_error:;
8676 
8677  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1035
8678  * # Cython code.
8679  * cdef inline int import_array() except -1:
8680  * try: # <<<<<<<<<<<<<<
8681  * _import_array()
8682  * except Exception:
8683  */
8684  __Pyx_XGIVEREF(__pyx_t_1);
8685  __Pyx_XGIVEREF(__pyx_t_2);
8686  __Pyx_XGIVEREF(__pyx_t_3);
8687  __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
8688  goto __pyx_L1_error;
8689  __pyx_L8_try_end:;
8690  }
8691 
8692  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1034
8693  * # Versions of the import_* functions which are more suitable for
8694  * # Cython code.
8695  * cdef inline int import_array() except -1: # <<<<<<<<<<<<<<
8696  * try:
8697  * _import_array()
8698  */
8699 
8700  /* function exit code */
8701  __pyx_r = 0;
8702  goto __pyx_L0;
8703  __pyx_L1_error:;
8704  __Pyx_XDECREF(__pyx_t_5);
8705  __Pyx_XDECREF(__pyx_t_6);
8706  __Pyx_XDECREF(__pyx_t_7);
8707  __Pyx_XDECREF(__pyx_t_8);
8708  __Pyx_AddTraceback("numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
8709  __pyx_r = -1;
8710  __pyx_L0:;
8711  __Pyx_RefNannyFinishContext();
8712  return __pyx_r;
8713 }
8714 
8715 /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1040
8716  * raise ImportError("numpy.core.multiarray failed to import")
8717  *
8718  * cdef inline int import_umath() except -1: # <<<<<<<<<<<<<<
8719  * try:
8720  * _import_umath()
8721  */
8722 
8723 static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) {
8724  int __pyx_r;
8725  __Pyx_RefNannyDeclarations
8726  PyObject *__pyx_t_1 = NULL;
8727  PyObject *__pyx_t_2 = NULL;
8728  PyObject *__pyx_t_3 = NULL;
8729  int __pyx_t_4;
8730  PyObject *__pyx_t_5 = NULL;
8731  PyObject *__pyx_t_6 = NULL;
8732  PyObject *__pyx_t_7 = NULL;
8733  PyObject *__pyx_t_8 = NULL;
8734  __Pyx_RefNannySetupContext("import_umath", 0);
8735 
8736  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1041
8737  *
8738  * cdef inline int import_umath() except -1:
8739  * try: # <<<<<<<<<<<<<<
8740  * _import_umath()
8741  * except Exception:
8742  */
8743  {
8744  __Pyx_PyThreadState_declare
8745  __Pyx_PyThreadState_assign
8746  __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
8747  __Pyx_XGOTREF(__pyx_t_1);
8748  __Pyx_XGOTREF(__pyx_t_2);
8749  __Pyx_XGOTREF(__pyx_t_3);
8750  /*try:*/ {
8751 
8752  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1042
8753  * cdef inline int import_umath() except -1:
8754  * try:
8755  * _import_umath() # <<<<<<<<<<<<<<
8756  * except Exception:
8757  * raise ImportError("numpy.core.umath failed to import")
8758  */
8759  __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 1042, __pyx_L3_error)
8760 
8761  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1041
8762  *
8763  * cdef inline int import_umath() except -1:
8764  * try: # <<<<<<<<<<<<<<
8765  * _import_umath()
8766  * except Exception:
8767  */
8768  }
8769  __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
8770  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
8771  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
8772  goto __pyx_L8_try_end;
8773  __pyx_L3_error:;
8774 
8775  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1043
8776  * try:
8777  * _import_umath()
8778  * except Exception: # <<<<<<<<<<<<<<
8779  * raise ImportError("numpy.core.umath failed to import")
8780  *
8781  */
8782  __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
8783  if (__pyx_t_4) {
8784  __Pyx_AddTraceback("numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename);
8785  if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(1, 1043, __pyx_L5_except_error)
8786  __Pyx_GOTREF(__pyx_t_5);
8787  __Pyx_GOTREF(__pyx_t_6);
8788  __Pyx_GOTREF(__pyx_t_7);
8789 
8790  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1044
8791  * _import_umath()
8792  * except Exception:
8793  * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<<
8794  *
8795  * cdef inline int import_ufunc() except -1:
8796  */
8797  __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__7, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 1044, __pyx_L5_except_error)
8798  __Pyx_GOTREF(__pyx_t_8);
8799  __Pyx_Raise(__pyx_t_8, 0, 0, 0);
8800  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
8801  __PYX_ERR(1, 1044, __pyx_L5_except_error)
8802  }
8803  goto __pyx_L5_except_error;
8804  __pyx_L5_except_error:;
8805 
8806  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1041
8807  *
8808  * cdef inline int import_umath() except -1:
8809  * try: # <<<<<<<<<<<<<<
8810  * _import_umath()
8811  * except Exception:
8812  */
8813  __Pyx_XGIVEREF(__pyx_t_1);
8814  __Pyx_XGIVEREF(__pyx_t_2);
8815  __Pyx_XGIVEREF(__pyx_t_3);
8816  __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
8817  goto __pyx_L1_error;
8818  __pyx_L8_try_end:;
8819  }
8820 
8821  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1040
8822  * raise ImportError("numpy.core.multiarray failed to import")
8823  *
8824  * cdef inline int import_umath() except -1: # <<<<<<<<<<<<<<
8825  * try:
8826  * _import_umath()
8827  */
8828 
8829  /* function exit code */
8830  __pyx_r = 0;
8831  goto __pyx_L0;
8832  __pyx_L1_error:;
8833  __Pyx_XDECREF(__pyx_t_5);
8834  __Pyx_XDECREF(__pyx_t_6);
8835  __Pyx_XDECREF(__pyx_t_7);
8836  __Pyx_XDECREF(__pyx_t_8);
8837  __Pyx_AddTraceback("numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename);
8838  __pyx_r = -1;
8839  __pyx_L0:;
8840  __Pyx_RefNannyFinishContext();
8841  return __pyx_r;
8842 }
8843 
8844 /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1046
8845  * raise ImportError("numpy.core.umath failed to import")
8846  *
8847  * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<<
8848  * try:
8849  * _import_umath()
8850  */
8851 
8852 static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) {
8853  int __pyx_r;
8854  __Pyx_RefNannyDeclarations
8855  PyObject *__pyx_t_1 = NULL;
8856  PyObject *__pyx_t_2 = NULL;
8857  PyObject *__pyx_t_3 = NULL;
8858  int __pyx_t_4;
8859  PyObject *__pyx_t_5 = NULL;
8860  PyObject *__pyx_t_6 = NULL;
8861  PyObject *__pyx_t_7 = NULL;
8862  PyObject *__pyx_t_8 = NULL;
8863  __Pyx_RefNannySetupContext("import_ufunc", 0);
8864 
8865  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1047
8866  *
8867  * cdef inline int import_ufunc() except -1:
8868  * try: # <<<<<<<<<<<<<<
8869  * _import_umath()
8870  * except Exception:
8871  */
8872  {
8873  __Pyx_PyThreadState_declare
8874  __Pyx_PyThreadState_assign
8875  __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
8876  __Pyx_XGOTREF(__pyx_t_1);
8877  __Pyx_XGOTREF(__pyx_t_2);
8878  __Pyx_XGOTREF(__pyx_t_3);
8879  /*try:*/ {
8880 
8881  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1048
8882  * cdef inline int import_ufunc() except -1:
8883  * try:
8884  * _import_umath() # <<<<<<<<<<<<<<
8885  * except Exception:
8886  * raise ImportError("numpy.core.umath failed to import")
8887  */
8888  __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 1048, __pyx_L3_error)
8889 
8890  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1047
8891  *
8892  * cdef inline int import_ufunc() except -1:
8893  * try: # <<<<<<<<<<<<<<
8894  * _import_umath()
8895  * except Exception:
8896  */
8897  }
8898  __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
8899  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
8900  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
8901  goto __pyx_L8_try_end;
8902  __pyx_L3_error:;
8903 
8904  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1049
8905  * try:
8906  * _import_umath()
8907  * except Exception: # <<<<<<<<<<<<<<
8908  * raise ImportError("numpy.core.umath failed to import")
8909  */
8910  __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
8911  if (__pyx_t_4) {
8912  __Pyx_AddTraceback("numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename);
8913  if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(1, 1049, __pyx_L5_except_error)
8914  __Pyx_GOTREF(__pyx_t_5);
8915  __Pyx_GOTREF(__pyx_t_6);
8916  __Pyx_GOTREF(__pyx_t_7);
8917 
8918  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1050
8919  * _import_umath()
8920  * except Exception:
8921  * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<<
8922  */
8923  __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__7, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 1050, __pyx_L5_except_error)
8924  __Pyx_GOTREF(__pyx_t_8);
8925  __Pyx_Raise(__pyx_t_8, 0, 0, 0);
8926  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
8927  __PYX_ERR(1, 1050, __pyx_L5_except_error)
8928  }
8929  goto __pyx_L5_except_error;
8930  __pyx_L5_except_error:;
8931 
8932  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1047
8933  *
8934  * cdef inline int import_ufunc() except -1:
8935  * try: # <<<<<<<<<<<<<<
8936  * _import_umath()
8937  * except Exception:
8938  */
8939  __Pyx_XGIVEREF(__pyx_t_1);
8940  __Pyx_XGIVEREF(__pyx_t_2);
8941  __Pyx_XGIVEREF(__pyx_t_3);
8942  __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
8943  goto __pyx_L1_error;
8944  __pyx_L8_try_end:;
8945  }
8946 
8947  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1046
8948  * raise ImportError("numpy.core.umath failed to import")
8949  *
8950  * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<<
8951  * try:
8952  * _import_umath()
8953  */
8954 
8955  /* function exit code */
8956  __pyx_r = 0;
8957  goto __pyx_L0;
8958  __pyx_L1_error:;
8959  __Pyx_XDECREF(__pyx_t_5);
8960  __Pyx_XDECREF(__pyx_t_6);
8961  __Pyx_XDECREF(__pyx_t_7);
8962  __Pyx_XDECREF(__pyx_t_8);
8963  __Pyx_AddTraceback("numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename);
8964  __pyx_r = -1;
8965  __pyx_L0:;
8966  __Pyx_RefNannyFinishContext();
8967  return __pyx_r;
8968 }
8969 
8970 /* "View.MemoryView":122
8971  * cdef bint dtype_is_object
8972  *
8973  * def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None, # <<<<<<<<<<<<<<
8974  * mode="c", bint allocate_buffer=True):
8975  *
8976  */
8977 
8978 /* Python wrapper */
8979 static int __pyx_array___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
8980 static int __pyx_array___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
8981  PyObject *__pyx_v_shape = 0;
8982  Py_ssize_t __pyx_v_itemsize;
8983  PyObject *__pyx_v_format = 0;
8984  PyObject *__pyx_v_mode = 0;
8985  int __pyx_v_allocate_buffer;
8986  int __pyx_r;
8987  __Pyx_RefNannyDeclarations
8988  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
8989  {
8990  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_shape,&__pyx_n_s_itemsize,&__pyx_n_s_format,&__pyx_n_s_mode,&__pyx_n_s_allocate_buffer,0};
8991  PyObject* values[5] = {0,0,0,0,0};
8992  values[3] = ((PyObject *)__pyx_n_s_c);
8993  if (unlikely(__pyx_kwds)) {
8994  Py_ssize_t kw_args;
8995  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
8996  switch (pos_args) {
8997  case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
8998  CYTHON_FALLTHROUGH;
8999  case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
9000  CYTHON_FALLTHROUGH;
9001  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
9002  CYTHON_FALLTHROUGH;
9003  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
9004  CYTHON_FALLTHROUGH;
9005  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
9006  CYTHON_FALLTHROUGH;
9007  case 0: break;
9008  default: goto __pyx_L5_argtuple_error;
9009  }
9010  kw_args = PyDict_Size(__pyx_kwds);
9011  switch (pos_args) {
9012  case 0:
9013  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_shape)) != 0)) kw_args--;
9014  else goto __pyx_L5_argtuple_error;
9015  CYTHON_FALLTHROUGH;
9016  case 1:
9017  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_itemsize)) != 0)) kw_args--;
9018  else {
9019  __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, 1); __PYX_ERR(2, 122, __pyx_L3_error)
9020  }
9021  CYTHON_FALLTHROUGH;
9022  case 2:
9023  if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_format)) != 0)) kw_args--;
9024  else {
9025  __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, 2); __PYX_ERR(2, 122, __pyx_L3_error)
9026  }
9027  CYTHON_FALLTHROUGH;
9028  case 3:
9029  if (kw_args > 0) {
9030  PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mode);
9031  if (value) { values[3] = value; kw_args--; }
9032  }
9033  CYTHON_FALLTHROUGH;
9034  case 4:
9035  if (kw_args > 0) {
9036  PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_allocate_buffer);
9037  if (value) { values[4] = value; kw_args--; }
9038  }
9039  }
9040  if (unlikely(kw_args > 0)) {
9041  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(2, 122, __pyx_L3_error)
9042  }
9043  } else {
9044  switch (PyTuple_GET_SIZE(__pyx_args)) {
9045  case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
9046  CYTHON_FALLTHROUGH;
9047  case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
9048  CYTHON_FALLTHROUGH;
9049  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
9050  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
9051  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
9052  break;
9053  default: goto __pyx_L5_argtuple_error;
9054  }
9055  }
9056  __pyx_v_shape = ((PyObject*)values[0]);
9057  __pyx_v_itemsize = __Pyx_PyIndex_AsSsize_t(values[1]); if (unlikely((__pyx_v_itemsize == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(2, 122, __pyx_L3_error)
9058  __pyx_v_format = values[2];
9059  __pyx_v_mode = values[3];
9060  if (values[4]) {
9061  __pyx_v_allocate_buffer = __Pyx_PyObject_IsTrue(values[4]); if (unlikely((__pyx_v_allocate_buffer == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 123, __pyx_L3_error)
9062  } else {
9063 
9064  /* "View.MemoryView":123
9065  *
9066  * def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None,
9067  * mode="c", bint allocate_buffer=True): # <<<<<<<<<<<<<<
9068  *
9069  * cdef int idx
9070  */
9071  __pyx_v_allocate_buffer = ((int)1);
9072  }
9073  }
9074  goto __pyx_L4_argument_unpacking_done;
9075  __pyx_L5_argtuple_error:;
9076  __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 122, __pyx_L3_error)
9077  __pyx_L3_error:;
9078  __Pyx_AddTraceback("View.MemoryView.array.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9079  __Pyx_RefNannyFinishContext();
9080  return -1;
9081  __pyx_L4_argument_unpacking_done:;
9082  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_shape), (&PyTuple_Type), 1, "shape", 1))) __PYX_ERR(2, 122, __pyx_L1_error)
9083  if (unlikely(((PyObject *)__pyx_v_format) == Py_None)) {
9084  PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "format"); __PYX_ERR(2, 122, __pyx_L1_error)
9085  }
9086  __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(((struct __pyx_array_obj *)__pyx_v_self), __pyx_v_shape, __pyx_v_itemsize, __pyx_v_format, __pyx_v_mode, __pyx_v_allocate_buffer);
9087 
9088  /* "View.MemoryView":122
9089  * cdef bint dtype_is_object
9090  *
9091  * def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None, # <<<<<<<<<<<<<<
9092  * mode="c", bint allocate_buffer=True):
9093  *
9094  */
9095 
9096  /* function exit code */
9097  goto __pyx_L0;
9098  __pyx_L1_error:;
9099  __pyx_r = -1;
9100  __pyx_L0:;
9101  __Pyx_RefNannyFinishContext();
9102  return __pyx_r;
9103 }
9104 
9105 static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_shape, Py_ssize_t __pyx_v_itemsize, PyObject *__pyx_v_format, PyObject *__pyx_v_mode, int __pyx_v_allocate_buffer) {
9106  int __pyx_v_idx;
9107  Py_ssize_t __pyx_v_i;
9108  Py_ssize_t __pyx_v_dim;
9109  PyObject **__pyx_v_p;
9110  char __pyx_v_order;
9111  int __pyx_r;
9112  __Pyx_RefNannyDeclarations
9113  Py_ssize_t __pyx_t_1;
9114  int __pyx_t_2;
9115  PyObject *__pyx_t_3 = NULL;
9116  int __pyx_t_4;
9117  PyObject *__pyx_t_5 = NULL;
9118  PyObject *__pyx_t_6 = NULL;
9119  char *__pyx_t_7;
9120  int __pyx_t_8;
9121  Py_ssize_t __pyx_t_9;
9122  PyObject *__pyx_t_10 = NULL;
9123  Py_ssize_t __pyx_t_11;
9124  __Pyx_RefNannySetupContext("__cinit__", 0);
9125  __Pyx_INCREF(__pyx_v_format);
9126 
9127  /* "View.MemoryView":129
9128  * cdef PyObject **p
9129  *
9130  * self.ndim = <int> len(shape) # <<<<<<<<<<<<<<
9131  * self.itemsize = itemsize
9132  *
9133  */
9134  if (unlikely(__pyx_v_shape == Py_None)) {
9135  PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
9136  __PYX_ERR(2, 129, __pyx_L1_error)
9137  }
9138  __pyx_t_1 = PyTuple_GET_SIZE(__pyx_v_shape); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(2, 129, __pyx_L1_error)
9139  __pyx_v_self->ndim = ((int)__pyx_t_1);
9140 
9141  /* "View.MemoryView":130
9142  *
9143  * self.ndim = <int> len(shape)
9144  * self.itemsize = itemsize # <<<<<<<<<<<<<<
9145  *
9146  * if not self.ndim:
9147  */
9148  __pyx_v_self->itemsize = __pyx_v_itemsize;
9149 
9150  /* "View.MemoryView":132
9151  * self.itemsize = itemsize
9152  *
9153  * if not self.ndim: # <<<<<<<<<<<<<<
9154  * raise ValueError("Empty shape tuple for cython.array")
9155  *
9156  */
9157  __pyx_t_2 = ((!(__pyx_v_self->ndim != 0)) != 0);
9158  if (unlikely(__pyx_t_2)) {
9159 
9160  /* "View.MemoryView":133
9161  *
9162  * if not self.ndim:
9163  * raise ValueError("Empty shape tuple for cython.array") # <<<<<<<<<<<<<<
9164  *
9165  * if itemsize <= 0:
9166  */
9167  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__8, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 133, __pyx_L1_error)
9168  __Pyx_GOTREF(__pyx_t_3);
9169  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
9170  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9171  __PYX_ERR(2, 133, __pyx_L1_error)
9172 
9173  /* "View.MemoryView":132
9174  * self.itemsize = itemsize
9175  *
9176  * if not self.ndim: # <<<<<<<<<<<<<<
9177  * raise ValueError("Empty shape tuple for cython.array")
9178  *
9179  */
9180  }
9181 
9182  /* "View.MemoryView":135
9183  * raise ValueError("Empty shape tuple for cython.array")
9184  *
9185  * if itemsize <= 0: # <<<<<<<<<<<<<<
9186  * raise ValueError("itemsize <= 0 for cython.array")
9187  *
9188  */
9189  __pyx_t_2 = ((__pyx_v_itemsize <= 0) != 0);
9190  if (unlikely(__pyx_t_2)) {
9191 
9192  /* "View.MemoryView":136
9193  *
9194  * if itemsize <= 0:
9195  * raise ValueError("itemsize <= 0 for cython.array") # <<<<<<<<<<<<<<
9196  *
9197  * if not isinstance(format, bytes):
9198  */
9199  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__9, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 136, __pyx_L1_error)
9200  __Pyx_GOTREF(__pyx_t_3);
9201  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
9202  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9203  __PYX_ERR(2, 136, __pyx_L1_error)
9204 
9205  /* "View.MemoryView":135
9206  * raise ValueError("Empty shape tuple for cython.array")
9207  *
9208  * if itemsize <= 0: # <<<<<<<<<<<<<<
9209  * raise ValueError("itemsize <= 0 for cython.array")
9210  *
9211  */
9212  }
9213 
9214  /* "View.MemoryView":138
9215  * raise ValueError("itemsize <= 0 for cython.array")
9216  *
9217  * if not isinstance(format, bytes): # <<<<<<<<<<<<<<
9218  * format = format.encode('ASCII')
9219  * self._format = format # keep a reference to the byte string
9220  */
9221  __pyx_t_2 = PyBytes_Check(__pyx_v_format);
9222  __pyx_t_4 = ((!(__pyx_t_2 != 0)) != 0);
9223  if (__pyx_t_4) {
9224 
9225  /* "View.MemoryView":139
9226  *
9227  * if not isinstance(format, bytes):
9228  * format = format.encode('ASCII') # <<<<<<<<<<<<<<
9229  * self._format = format # keep a reference to the byte string
9230  * self.format = self._format
9231  */
9232  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_format, __pyx_n_s_encode); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 139, __pyx_L1_error)
9233  __Pyx_GOTREF(__pyx_t_5);
9234  __pyx_t_6 = NULL;
9235  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
9236  __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
9237  if (likely(__pyx_t_6)) {
9238  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
9239  __Pyx_INCREF(__pyx_t_6);
9240  __Pyx_INCREF(function);
9241  __Pyx_DECREF_SET(__pyx_t_5, function);
9242  }
9243  }
9244  __pyx_t_3 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_6, __pyx_n_s_ASCII) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_n_s_ASCII);
9245  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
9246  if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 139, __pyx_L1_error)
9247  __Pyx_GOTREF(__pyx_t_3);
9248  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
9249  __Pyx_DECREF_SET(__pyx_v_format, __pyx_t_3);
9250  __pyx_t_3 = 0;
9251 
9252  /* "View.MemoryView":138
9253  * raise ValueError("itemsize <= 0 for cython.array")
9254  *
9255  * if not isinstance(format, bytes): # <<<<<<<<<<<<<<
9256  * format = format.encode('ASCII')
9257  * self._format = format # keep a reference to the byte string
9258  */
9259  }
9260 
9261  /* "View.MemoryView":140
9262  * if not isinstance(format, bytes):
9263  * format = format.encode('ASCII')
9264  * self._format = format # keep a reference to the byte string # <<<<<<<<<<<<<<
9265  * self.format = self._format
9266  *
9267  */
9268  if (!(likely(PyBytes_CheckExact(__pyx_v_format))||((__pyx_v_format) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_v_format)->tp_name), 0))) __PYX_ERR(2, 140, __pyx_L1_error)
9269  __pyx_t_3 = __pyx_v_format;
9270  __Pyx_INCREF(__pyx_t_3);
9271  __Pyx_GIVEREF(__pyx_t_3);
9272  __Pyx_GOTREF(__pyx_v_self->_format);
9273  __Pyx_DECREF(__pyx_v_self->_format);
9274  __pyx_v_self->_format = ((PyObject*)__pyx_t_3);
9275  __pyx_t_3 = 0;
9276 
9277  /* "View.MemoryView":141
9278  * format = format.encode('ASCII')
9279  * self._format = format # keep a reference to the byte string
9280  * self.format = self._format # <<<<<<<<<<<<<<
9281  *
9282  *
9283  */
9284  if (unlikely(__pyx_v_self->_format == Py_None)) {
9285  PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found");
9286  __PYX_ERR(2, 141, __pyx_L1_error)
9287  }
9288  __pyx_t_7 = __Pyx_PyBytes_AsWritableString(__pyx_v_self->_format); if (unlikely((!__pyx_t_7) && PyErr_Occurred())) __PYX_ERR(2, 141, __pyx_L1_error)
9289  __pyx_v_self->format = __pyx_t_7;
9290 
9291  /* "View.MemoryView":144
9292  *
9293  *
9294  * self._shape = <Py_ssize_t *> PyObject_Malloc(sizeof(Py_ssize_t)*self.ndim*2) # <<<<<<<<<<<<<<
9295  * self._strides = self._shape + self.ndim
9296  *
9297  */
9298  __pyx_v_self->_shape = ((Py_ssize_t *)PyObject_Malloc((((sizeof(Py_ssize_t)) * __pyx_v_self->ndim) * 2)));
9299 
9300  /* "View.MemoryView":145
9301  *
9302  * self._shape = <Py_ssize_t *> PyObject_Malloc(sizeof(Py_ssize_t)*self.ndim*2)
9303  * self._strides = self._shape + self.ndim # <<<<<<<<<<<<<<
9304  *
9305  * if not self._shape:
9306  */
9307  __pyx_v_self->_strides = (__pyx_v_self->_shape + __pyx_v_self->ndim);
9308 
9309  /* "View.MemoryView":147
9310  * self._strides = self._shape + self.ndim
9311  *
9312  * if not self._shape: # <<<<<<<<<<<<<<
9313  * raise MemoryError("unable to allocate shape and strides.")
9314  *
9315  */
9316  __pyx_t_4 = ((!(__pyx_v_self->_shape != 0)) != 0);
9317  if (unlikely(__pyx_t_4)) {
9318 
9319  /* "View.MemoryView":148
9320  *
9321  * if not self._shape:
9322  * raise MemoryError("unable to allocate shape and strides.") # <<<<<<<<<<<<<<
9323  *
9324  *
9325  */
9326  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__10, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 148, __pyx_L1_error)
9327  __Pyx_GOTREF(__pyx_t_3);
9328  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
9329  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9330  __PYX_ERR(2, 148, __pyx_L1_error)
9331 
9332  /* "View.MemoryView":147
9333  * self._strides = self._shape + self.ndim
9334  *
9335  * if not self._shape: # <<<<<<<<<<<<<<
9336  * raise MemoryError("unable to allocate shape and strides.")
9337  *
9338  */
9339  }
9340 
9341  /* "View.MemoryView":151
9342  *
9343  *
9344  * for idx, dim in enumerate(shape): # <<<<<<<<<<<<<<
9345  * if dim <= 0:
9346  * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim))
9347  */
9348  __pyx_t_8 = 0;
9349  __pyx_t_3 = __pyx_v_shape; __Pyx_INCREF(__pyx_t_3); __pyx_t_1 = 0;
9350  for (;;) {
9351  if (__pyx_t_1 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
9352  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
9353  __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_1); __Pyx_INCREF(__pyx_t_5); __pyx_t_1++; if (unlikely(0 < 0)) __PYX_ERR(2, 151, __pyx_L1_error)
9354  #else
9355  __pyx_t_5 = PySequence_ITEM(__pyx_t_3, __pyx_t_1); __pyx_t_1++; if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 151, __pyx_L1_error)
9356  __Pyx_GOTREF(__pyx_t_5);
9357  #endif
9358  __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_5); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(2, 151, __pyx_L1_error)
9359  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
9360  __pyx_v_dim = __pyx_t_9;
9361  __pyx_v_idx = __pyx_t_8;
9362  __pyx_t_8 = (__pyx_t_8 + 1);
9363 
9364  /* "View.MemoryView":152
9365  *
9366  * for idx, dim in enumerate(shape):
9367  * if dim <= 0: # <<<<<<<<<<<<<<
9368  * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim))
9369  * self._shape[idx] = dim
9370  */
9371  __pyx_t_4 = ((__pyx_v_dim <= 0) != 0);
9372  if (unlikely(__pyx_t_4)) {
9373 
9374  /* "View.MemoryView":153
9375  * for idx, dim in enumerate(shape):
9376  * if dim <= 0:
9377  * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim)) # <<<<<<<<<<<<<<
9378  * self._shape[idx] = dim
9379  *
9380  */
9381  __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_idx); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 153, __pyx_L1_error)
9382  __Pyx_GOTREF(__pyx_t_5);
9383  __pyx_t_6 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 153, __pyx_L1_error)
9384  __Pyx_GOTREF(__pyx_t_6);
9385  __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 153, __pyx_L1_error)
9386  __Pyx_GOTREF(__pyx_t_10);
9387  __Pyx_GIVEREF(__pyx_t_5);
9388  PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_5);
9389  __Pyx_GIVEREF(__pyx_t_6);
9390  PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_6);
9391  __pyx_t_5 = 0;
9392  __pyx_t_6 = 0;
9393  __pyx_t_6 = __Pyx_PyString_Format(__pyx_kp_s_Invalid_shape_in_axis_d_d, __pyx_t_10); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 153, __pyx_L1_error)
9394  __Pyx_GOTREF(__pyx_t_6);
9395  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
9396  __pyx_t_10 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_6); if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 153, __pyx_L1_error)
9397  __Pyx_GOTREF(__pyx_t_10);
9398  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
9399  __Pyx_Raise(__pyx_t_10, 0, 0, 0);
9400  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
9401  __PYX_ERR(2, 153, __pyx_L1_error)
9402 
9403  /* "View.MemoryView":152
9404  *
9405  * for idx, dim in enumerate(shape):
9406  * if dim <= 0: # <<<<<<<<<<<<<<
9407  * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim))
9408  * self._shape[idx] = dim
9409  */
9410  }
9411 
9412  /* "View.MemoryView":154
9413  * if dim <= 0:
9414  * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim))
9415  * self._shape[idx] = dim # <<<<<<<<<<<<<<
9416  *
9417  * cdef char order
9418  */
9419  (__pyx_v_self->_shape[__pyx_v_idx]) = __pyx_v_dim;
9420 
9421  /* "View.MemoryView":151
9422  *
9423  *
9424  * for idx, dim in enumerate(shape): # <<<<<<<<<<<<<<
9425  * if dim <= 0:
9426  * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim))
9427  */
9428  }
9429  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9430 
9431  /* "View.MemoryView":157
9432  *
9433  * cdef char order
9434  * if mode == 'fortran': # <<<<<<<<<<<<<<
9435  * order = b'F'
9436  * self.mode = u'fortran'
9437  */
9438  __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_fortran, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(2, 157, __pyx_L1_error)
9439  if (__pyx_t_4) {
9440 
9441  /* "View.MemoryView":158
9442  * cdef char order
9443  * if mode == 'fortran':
9444  * order = b'F' # <<<<<<<<<<<<<<
9445  * self.mode = u'fortran'
9446  * elif mode == 'c':
9447  */
9448  __pyx_v_order = 'F';
9449 
9450  /* "View.MemoryView":159
9451  * if mode == 'fortran':
9452  * order = b'F'
9453  * self.mode = u'fortran' # <<<<<<<<<<<<<<
9454  * elif mode == 'c':
9455  * order = b'C'
9456  */
9457  __Pyx_INCREF(__pyx_n_u_fortran);
9458  __Pyx_GIVEREF(__pyx_n_u_fortran);
9459  __Pyx_GOTREF(__pyx_v_self->mode);
9460  __Pyx_DECREF(__pyx_v_self->mode);
9461  __pyx_v_self->mode = __pyx_n_u_fortran;
9462 
9463  /* "View.MemoryView":157
9464  *
9465  * cdef char order
9466  * if mode == 'fortran': # <<<<<<<<<<<<<<
9467  * order = b'F'
9468  * self.mode = u'fortran'
9469  */
9470  goto __pyx_L10;
9471  }
9472 
9473  /* "View.MemoryView":160
9474  * order = b'F'
9475  * self.mode = u'fortran'
9476  * elif mode == 'c': # <<<<<<<<<<<<<<
9477  * order = b'C'
9478  * self.mode = u'c'
9479  */
9480  __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_c, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(2, 160, __pyx_L1_error)
9481  if (likely(__pyx_t_4)) {
9482 
9483  /* "View.MemoryView":161
9484  * self.mode = u'fortran'
9485  * elif mode == 'c':
9486  * order = b'C' # <<<<<<<<<<<<<<
9487  * self.mode = u'c'
9488  * else:
9489  */
9490  __pyx_v_order = 'C';
9491 
9492  /* "View.MemoryView":162
9493  * elif mode == 'c':
9494  * order = b'C'
9495  * self.mode = u'c' # <<<<<<<<<<<<<<
9496  * else:
9497  * raise ValueError("Invalid mode, expected 'c' or 'fortran', got %s" % mode)
9498  */
9499  __Pyx_INCREF(__pyx_n_u_c);
9500  __Pyx_GIVEREF(__pyx_n_u_c);
9501  __Pyx_GOTREF(__pyx_v_self->mode);
9502  __Pyx_DECREF(__pyx_v_self->mode);
9503  __pyx_v_self->mode = __pyx_n_u_c;
9504 
9505  /* "View.MemoryView":160
9506  * order = b'F'
9507  * self.mode = u'fortran'
9508  * elif mode == 'c': # <<<<<<<<<<<<<<
9509  * order = b'C'
9510  * self.mode = u'c'
9511  */
9512  goto __pyx_L10;
9513  }
9514 
9515  /* "View.MemoryView":164
9516  * self.mode = u'c'
9517  * else:
9518  * raise ValueError("Invalid mode, expected 'c' or 'fortran', got %s" % mode) # <<<<<<<<<<<<<<
9519  *
9520  * self.len = fill_contig_strides_array(self._shape, self._strides,
9521  */
9522  /*else*/ {
9523  __pyx_t_3 = __Pyx_PyString_FormatSafe(__pyx_kp_s_Invalid_mode_expected_c_or_fortr, __pyx_v_mode); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 164, __pyx_L1_error)
9524  __Pyx_GOTREF(__pyx_t_3);
9525  __pyx_t_10 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 164, __pyx_L1_error)
9526  __Pyx_GOTREF(__pyx_t_10);
9527  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9528  __Pyx_Raise(__pyx_t_10, 0, 0, 0);
9529  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
9530  __PYX_ERR(2, 164, __pyx_L1_error)
9531  }
9532  __pyx_L10:;
9533 
9534  /* "View.MemoryView":166
9535  * raise ValueError("Invalid mode, expected 'c' or 'fortran', got %s" % mode)
9536  *
9537  * self.len = fill_contig_strides_array(self._shape, self._strides, # <<<<<<<<<<<<<<
9538  * itemsize, self.ndim, order)
9539  *
9540  */
9541  __pyx_v_self->len = __pyx_fill_contig_strides_array(__pyx_v_self->_shape, __pyx_v_self->_strides, __pyx_v_itemsize, __pyx_v_self->ndim, __pyx_v_order);
9542 
9543  /* "View.MemoryView":169
9544  * itemsize, self.ndim, order)
9545  *
9546  * self.free_data = allocate_buffer # <<<<<<<<<<<<<<
9547  * self.dtype_is_object = format == b'O'
9548  * if allocate_buffer:
9549  */
9550  __pyx_v_self->free_data = __pyx_v_allocate_buffer;
9551 
9552  /* "View.MemoryView":170
9553  *
9554  * self.free_data = allocate_buffer
9555  * self.dtype_is_object = format == b'O' # <<<<<<<<<<<<<<
9556  * if allocate_buffer:
9557  *
9558  */
9559  __pyx_t_10 = PyObject_RichCompare(__pyx_v_format, __pyx_n_b_O, Py_EQ); __Pyx_XGOTREF(__pyx_t_10); if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 170, __pyx_L1_error)
9560  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 170, __pyx_L1_error)
9561  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
9562  __pyx_v_self->dtype_is_object = __pyx_t_4;
9563 
9564  /* "View.MemoryView":171
9565  * self.free_data = allocate_buffer
9566  * self.dtype_is_object = format == b'O'
9567  * if allocate_buffer: # <<<<<<<<<<<<<<
9568  *
9569  *
9570  */
9571  __pyx_t_4 = (__pyx_v_allocate_buffer != 0);
9572  if (__pyx_t_4) {
9573 
9574  /* "View.MemoryView":174
9575  *
9576  *
9577  * self.data = <char *>malloc(self.len) # <<<<<<<<<<<<<<
9578  * if not self.data:
9579  * raise MemoryError("unable to allocate array data.")
9580  */
9581  __pyx_v_self->data = ((char *)malloc(__pyx_v_self->len));
9582 
9583  /* "View.MemoryView":175
9584  *
9585  * self.data = <char *>malloc(self.len)
9586  * if not self.data: # <<<<<<<<<<<<<<
9587  * raise MemoryError("unable to allocate array data.")
9588  *
9589  */
9590  __pyx_t_4 = ((!(__pyx_v_self->data != 0)) != 0);
9591  if (unlikely(__pyx_t_4)) {
9592 
9593  /* "View.MemoryView":176
9594  * self.data = <char *>malloc(self.len)
9595  * if not self.data:
9596  * raise MemoryError("unable to allocate array data.") # <<<<<<<<<<<<<<
9597  *
9598  * if self.dtype_is_object:
9599  */
9600  __pyx_t_10 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__11, NULL); if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 176, __pyx_L1_error)
9601  __Pyx_GOTREF(__pyx_t_10);
9602  __Pyx_Raise(__pyx_t_10, 0, 0, 0);
9603  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
9604  __PYX_ERR(2, 176, __pyx_L1_error)
9605 
9606  /* "View.MemoryView":175
9607  *
9608  * self.data = <char *>malloc(self.len)
9609  * if not self.data: # <<<<<<<<<<<<<<
9610  * raise MemoryError("unable to allocate array data.")
9611  *
9612  */
9613  }
9614 
9615  /* "View.MemoryView":178
9616  * raise MemoryError("unable to allocate array data.")
9617  *
9618  * if self.dtype_is_object: # <<<<<<<<<<<<<<
9619  * p = <PyObject **> self.data
9620  * for i in range(self.len / itemsize):
9621  */
9622  __pyx_t_4 = (__pyx_v_self->dtype_is_object != 0);
9623  if (__pyx_t_4) {
9624 
9625  /* "View.MemoryView":179
9626  *
9627  * if self.dtype_is_object:
9628  * p = <PyObject **> self.data # <<<<<<<<<<<<<<
9629  * for i in range(self.len / itemsize):
9630  * p[i] = Py_None
9631  */
9632  __pyx_v_p = ((PyObject **)__pyx_v_self->data);
9633 
9634  /* "View.MemoryView":180
9635  * if self.dtype_is_object:
9636  * p = <PyObject **> self.data
9637  * for i in range(self.len / itemsize): # <<<<<<<<<<<<<<
9638  * p[i] = Py_None
9639  * Py_INCREF(Py_None)
9640  */
9641  if (unlikely(__pyx_v_itemsize == 0)) {
9642  PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero");
9643  __PYX_ERR(2, 180, __pyx_L1_error)
9644  }
9645  else if (sizeof(Py_ssize_t) == sizeof(long) && (!(((Py_ssize_t)-1) > 0)) && unlikely(__pyx_v_itemsize == (Py_ssize_t)-1) && unlikely(UNARY_NEG_WOULD_OVERFLOW(__pyx_v_self->len))) {
9646  PyErr_SetString(PyExc_OverflowError, "value too large to perform division");
9647  __PYX_ERR(2, 180, __pyx_L1_error)
9648  }
9649  __pyx_t_1 = __Pyx_div_Py_ssize_t(__pyx_v_self->len, __pyx_v_itemsize);
9650  __pyx_t_9 = __pyx_t_1;
9651  for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_9; __pyx_t_11+=1) {
9652  __pyx_v_i = __pyx_t_11;
9653 
9654  /* "View.MemoryView":181
9655  * p = <PyObject **> self.data
9656  * for i in range(self.len / itemsize):
9657  * p[i] = Py_None # <<<<<<<<<<<<<<
9658  * Py_INCREF(Py_None)
9659  *
9660  */
9661  (__pyx_v_p[__pyx_v_i]) = Py_None;
9662 
9663  /* "View.MemoryView":182
9664  * for i in range(self.len / itemsize):
9665  * p[i] = Py_None
9666  * Py_INCREF(Py_None) # <<<<<<<<<<<<<<
9667  *
9668  * @cname('getbuffer')
9669  */
9670  Py_INCREF(Py_None);
9671  }
9672 
9673  /* "View.MemoryView":178
9674  * raise MemoryError("unable to allocate array data.")
9675  *
9676  * if self.dtype_is_object: # <<<<<<<<<<<<<<
9677  * p = <PyObject **> self.data
9678  * for i in range(self.len / itemsize):
9679  */
9680  }
9681 
9682  /* "View.MemoryView":171
9683  * self.free_data = allocate_buffer
9684  * self.dtype_is_object = format == b'O'
9685  * if allocate_buffer: # <<<<<<<<<<<<<<
9686  *
9687  *
9688  */
9689  }
9690 
9691  /* "View.MemoryView":122
9692  * cdef bint dtype_is_object
9693  *
9694  * def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None, # <<<<<<<<<<<<<<
9695  * mode="c", bint allocate_buffer=True):
9696  *
9697  */
9698 
9699  /* function exit code */
9700  __pyx_r = 0;
9701  goto __pyx_L0;
9702  __pyx_L1_error:;
9703  __Pyx_XDECREF(__pyx_t_3);
9704  __Pyx_XDECREF(__pyx_t_5);
9705  __Pyx_XDECREF(__pyx_t_6);
9706  __Pyx_XDECREF(__pyx_t_10);
9707  __Pyx_AddTraceback("View.MemoryView.array.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9708  __pyx_r = -1;
9709  __pyx_L0:;
9710  __Pyx_XDECREF(__pyx_v_format);
9711  __Pyx_RefNannyFinishContext();
9712  return __pyx_r;
9713 }
9714 
9715 /* "View.MemoryView":185
9716  *
9717  * @cname('getbuffer')
9718  * def __getbuffer__(self, Py_buffer *info, int flags): # <<<<<<<<<<<<<<
9719  * cdef int bufmode = -1
9720  * if self.mode == u"c":
9721  */
9722 
9723 /* Python wrapper */
9724 static CYTHON_UNUSED int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
9725 static CYTHON_UNUSED int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
9726  int __pyx_r;
9727  __Pyx_RefNannyDeclarations
9728  __Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0);
9729  __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(((struct __pyx_array_obj *)__pyx_v_self), ((Py_buffer *)__pyx_v_info), ((int)__pyx_v_flags));
9730 
9731  /* function exit code */
9732  __Pyx_RefNannyFinishContext();
9733  return __pyx_r;
9734 }
9735 
9736 static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(struct __pyx_array_obj *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
9737  int __pyx_v_bufmode;
9738  int __pyx_r;
9739  __Pyx_RefNannyDeclarations
9740  int __pyx_t_1;
9741  int __pyx_t_2;
9742  PyObject *__pyx_t_3 = NULL;
9743  char *__pyx_t_4;
9744  Py_ssize_t __pyx_t_5;
9745  int __pyx_t_6;
9746  Py_ssize_t *__pyx_t_7;
9747  if (__pyx_v_info == NULL) {
9748  PyErr_SetString(PyExc_BufferError, "PyObject_GetBuffer: view==NULL argument is obsolete");
9749  return -1;
9750  }
9751  __Pyx_RefNannySetupContext("__getbuffer__", 0);
9752  __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None);
9753  __Pyx_GIVEREF(__pyx_v_info->obj);
9754 
9755  /* "View.MemoryView":186
9756  * @cname('getbuffer')
9757  * def __getbuffer__(self, Py_buffer *info, int flags):
9758  * cdef int bufmode = -1 # <<<<<<<<<<<<<<
9759  * if self.mode == u"c":
9760  * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
9761  */
9762  __pyx_v_bufmode = -1;
9763 
9764  /* "View.MemoryView":187
9765  * def __getbuffer__(self, Py_buffer *info, int flags):
9766  * cdef int bufmode = -1
9767  * if self.mode == u"c": # <<<<<<<<<<<<<<
9768  * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
9769  * elif self.mode == u"fortran":
9770  */
9771  __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_self->mode, __pyx_n_u_c, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(2, 187, __pyx_L1_error)
9772  __pyx_t_2 = (__pyx_t_1 != 0);
9773  if (__pyx_t_2) {
9774 
9775  /* "View.MemoryView":188
9776  * cdef int bufmode = -1
9777  * if self.mode == u"c":
9778  * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS # <<<<<<<<<<<<<<
9779  * elif self.mode == u"fortran":
9780  * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
9781  */
9782  __pyx_v_bufmode = (PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS);
9783 
9784  /* "View.MemoryView":187
9785  * def __getbuffer__(self, Py_buffer *info, int flags):
9786  * cdef int bufmode = -1
9787  * if self.mode == u"c": # <<<<<<<<<<<<<<
9788  * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
9789  * elif self.mode == u"fortran":
9790  */
9791  goto __pyx_L3;
9792  }
9793 
9794  /* "View.MemoryView":189
9795  * if self.mode == u"c":
9796  * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
9797  * elif self.mode == u"fortran": # <<<<<<<<<<<<<<
9798  * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
9799  * if not (flags & bufmode):
9800  */
9801  __pyx_t_2 = (__Pyx_PyUnicode_Equals(__pyx_v_self->mode, __pyx_n_u_fortran, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(2, 189, __pyx_L1_error)
9802  __pyx_t_1 = (__pyx_t_2 != 0);
9803  if (__pyx_t_1) {
9804 
9805  /* "View.MemoryView":190
9806  * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
9807  * elif self.mode == u"fortran":
9808  * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS # <<<<<<<<<<<<<<
9809  * if not (flags & bufmode):
9810  * raise ValueError("Can only create a buffer that is contiguous in memory.")
9811  */
9812  __pyx_v_bufmode = (PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS);
9813 
9814  /* "View.MemoryView":189
9815  * if self.mode == u"c":
9816  * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
9817  * elif self.mode == u"fortran": # <<<<<<<<<<<<<<
9818  * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
9819  * if not (flags & bufmode):
9820  */
9821  }
9822  __pyx_L3:;
9823 
9824  /* "View.MemoryView":191
9825  * elif self.mode == u"fortran":
9826  * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
9827  * if not (flags & bufmode): # <<<<<<<<<<<<<<
9828  * raise ValueError("Can only create a buffer that is contiguous in memory.")
9829  * info.buf = self.data
9830  */
9831  __pyx_t_1 = ((!((__pyx_v_flags & __pyx_v_bufmode) != 0)) != 0);
9832  if (unlikely(__pyx_t_1)) {
9833 
9834  /* "View.MemoryView":192
9835  * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
9836  * if not (flags & bufmode):
9837  * raise ValueError("Can only create a buffer that is contiguous in memory.") # <<<<<<<<<<<<<<
9838  * info.buf = self.data
9839  * info.len = self.len
9840  */
9841  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__12, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 192, __pyx_L1_error)
9842  __Pyx_GOTREF(__pyx_t_3);
9843  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
9844  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9845  __PYX_ERR(2, 192, __pyx_L1_error)
9846 
9847  /* "View.MemoryView":191
9848  * elif self.mode == u"fortran":
9849  * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
9850  * if not (flags & bufmode): # <<<<<<<<<<<<<<
9851  * raise ValueError("Can only create a buffer that is contiguous in memory.")
9852  * info.buf = self.data
9853  */
9854  }
9855 
9856  /* "View.MemoryView":193
9857  * if not (flags & bufmode):
9858  * raise ValueError("Can only create a buffer that is contiguous in memory.")
9859  * info.buf = self.data # <<<<<<<<<<<<<<
9860  * info.len = self.len
9861  * info.ndim = self.ndim
9862  */
9863  __pyx_t_4 = __pyx_v_self->data;
9864  __pyx_v_info->buf = __pyx_t_4;
9865 
9866  /* "View.MemoryView":194
9867  * raise ValueError("Can only create a buffer that is contiguous in memory.")
9868  * info.buf = self.data
9869  * info.len = self.len # <<<<<<<<<<<<<<
9870  * info.ndim = self.ndim
9871  * info.shape = self._shape
9872  */
9873  __pyx_t_5 = __pyx_v_self->len;
9874  __pyx_v_info->len = __pyx_t_5;
9875 
9876  /* "View.MemoryView":195
9877  * info.buf = self.data
9878  * info.len = self.len
9879  * info.ndim = self.ndim # <<<<<<<<<<<<<<
9880  * info.shape = self._shape
9881  * info.strides = self._strides
9882  */
9883  __pyx_t_6 = __pyx_v_self->ndim;
9884  __pyx_v_info->ndim = __pyx_t_6;
9885 
9886  /* "View.MemoryView":196
9887  * info.len = self.len
9888  * info.ndim = self.ndim
9889  * info.shape = self._shape # <<<<<<<<<<<<<<
9890  * info.strides = self._strides
9891  * info.suboffsets = NULL
9892  */
9893  __pyx_t_7 = __pyx_v_self->_shape;
9894  __pyx_v_info->shape = __pyx_t_7;
9895 
9896  /* "View.MemoryView":197
9897  * info.ndim = self.ndim
9898  * info.shape = self._shape
9899  * info.strides = self._strides # <<<<<<<<<<<<<<
9900  * info.suboffsets = NULL
9901  * info.itemsize = self.itemsize
9902  */
9903  __pyx_t_7 = __pyx_v_self->_strides;
9904  __pyx_v_info->strides = __pyx_t_7;
9905 
9906  /* "View.MemoryView":198
9907  * info.shape = self._shape
9908  * info.strides = self._strides
9909  * info.suboffsets = NULL # <<<<<<<<<<<<<<
9910  * info.itemsize = self.itemsize
9911  * info.readonly = 0
9912  */
9913  __pyx_v_info->suboffsets = NULL;
9914 
9915  /* "View.MemoryView":199
9916  * info.strides = self._strides
9917  * info.suboffsets = NULL
9918  * info.itemsize = self.itemsize # <<<<<<<<<<<<<<
9919  * info.readonly = 0
9920  *
9921  */
9922  __pyx_t_5 = __pyx_v_self->itemsize;
9923  __pyx_v_info->itemsize = __pyx_t_5;
9924 
9925  /* "View.MemoryView":200
9926  * info.suboffsets = NULL
9927  * info.itemsize = self.itemsize
9928  * info.readonly = 0 # <<<<<<<<<<<<<<
9929  *
9930  * if flags & PyBUF_FORMAT:
9931  */
9932  __pyx_v_info->readonly = 0;
9933 
9934  /* "View.MemoryView":202
9935  * info.readonly = 0
9936  *
9937  * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
9938  * info.format = self.format
9939  * else:
9940  */
9941  __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0);
9942  if (__pyx_t_1) {
9943 
9944  /* "View.MemoryView":203
9945  *
9946  * if flags & PyBUF_FORMAT:
9947  * info.format = self.format # <<<<<<<<<<<<<<
9948  * else:
9949  * info.format = NULL
9950  */
9951  __pyx_t_4 = __pyx_v_self->format;
9952  __pyx_v_info->format = __pyx_t_4;
9953 
9954  /* "View.MemoryView":202
9955  * info.readonly = 0
9956  *
9957  * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
9958  * info.format = self.format
9959  * else:
9960  */
9961  goto __pyx_L5;
9962  }
9963 
9964  /* "View.MemoryView":205
9965  * info.format = self.format
9966  * else:
9967  * info.format = NULL # <<<<<<<<<<<<<<
9968  *
9969  * info.obj = self
9970  */
9971  /*else*/ {
9972  __pyx_v_info->format = NULL;
9973  }
9974  __pyx_L5:;
9975 
9976  /* "View.MemoryView":207
9977  * info.format = NULL
9978  *
9979  * info.obj = self # <<<<<<<<<<<<<<
9980  *
9981  * __pyx_getbuffer = capsule(<void *> &__pyx_array_getbuffer, "getbuffer(obj, view, flags)")
9982  */
9983  __Pyx_INCREF(((PyObject *)__pyx_v_self));
9984  __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
9985  __Pyx_GOTREF(__pyx_v_info->obj);
9986  __Pyx_DECREF(__pyx_v_info->obj);
9987  __pyx_v_info->obj = ((PyObject *)__pyx_v_self);
9988 
9989  /* "View.MemoryView":185
9990  *
9991  * @cname('getbuffer')
9992  * def __getbuffer__(self, Py_buffer *info, int flags): # <<<<<<<<<<<<<<
9993  * cdef int bufmode = -1
9994  * if self.mode == u"c":
9995  */
9996 
9997  /* function exit code */
9998  __pyx_r = 0;
9999  goto __pyx_L0;
10000  __pyx_L1_error:;
10001  __Pyx_XDECREF(__pyx_t_3);
10002  __Pyx_AddTraceback("View.MemoryView.array.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10003  __pyx_r = -1;
10004  if (__pyx_v_info->obj != NULL) {
10005  __Pyx_GOTREF(__pyx_v_info->obj);
10006  __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
10007  }
10008  goto __pyx_L2;
10009  __pyx_L0:;
10010  if (__pyx_v_info->obj == Py_None) {
10011  __Pyx_GOTREF(__pyx_v_info->obj);
10012  __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
10013  }
10014  __pyx_L2:;
10015  __Pyx_RefNannyFinishContext();
10016  return __pyx_r;
10017 }
10018 
10019 /* "View.MemoryView":211
10020  * __pyx_getbuffer = capsule(<void *> &__pyx_array_getbuffer, "getbuffer(obj, view, flags)")
10021  *
10022  * def __dealloc__(array self): # <<<<<<<<<<<<<<
10023  * if self.callback_free_data != NULL:
10024  * self.callback_free_data(self.data)
10025  */
10026 
10027 /* Python wrapper */
10028 static void __pyx_array___dealloc__(PyObject *__pyx_v_self); /*proto*/
10029 static void __pyx_array___dealloc__(PyObject *__pyx_v_self) {
10030  __Pyx_RefNannyDeclarations
10031  __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
10032  __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(((struct __pyx_array_obj *)__pyx_v_self));
10033 
10034  /* function exit code */
10035  __Pyx_RefNannyFinishContext();
10036 }
10037 
10038 static void __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(struct __pyx_array_obj *__pyx_v_self) {
10039  __Pyx_RefNannyDeclarations
10040  int __pyx_t_1;
10041  __Pyx_RefNannySetupContext("__dealloc__", 0);
10042 
10043  /* "View.MemoryView":212
10044  *
10045  * def __dealloc__(array self):
10046  * if self.callback_free_data != NULL: # <<<<<<<<<<<<<<
10047  * self.callback_free_data(self.data)
10048  * elif self.free_data:
10049  */
10050  __pyx_t_1 = ((__pyx_v_self->callback_free_data != NULL) != 0);
10051  if (__pyx_t_1) {
10052 
10053  /* "View.MemoryView":213
10054  * def __dealloc__(array self):
10055  * if self.callback_free_data != NULL:
10056  * self.callback_free_data(self.data) # <<<<<<<<<<<<<<
10057  * elif self.free_data:
10058  * if self.dtype_is_object:
10059  */
10060  __pyx_v_self->callback_free_data(__pyx_v_self->data);
10061 
10062  /* "View.MemoryView":212
10063  *
10064  * def __dealloc__(array self):
10065  * if self.callback_free_data != NULL: # <<<<<<<<<<<<<<
10066  * self.callback_free_data(self.data)
10067  * elif self.free_data:
10068  */
10069  goto __pyx_L3;
10070  }
10071 
10072  /* "View.MemoryView":214
10073  * if self.callback_free_data != NULL:
10074  * self.callback_free_data(self.data)
10075  * elif self.free_data: # <<<<<<<<<<<<<<
10076  * if self.dtype_is_object:
10077  * refcount_objects_in_slice(self.data, self._shape,
10078  */
10079  __pyx_t_1 = (__pyx_v_self->free_data != 0);
10080  if (__pyx_t_1) {
10081 
10082  /* "View.MemoryView":215
10083  * self.callback_free_data(self.data)
10084  * elif self.free_data:
10085  * if self.dtype_is_object: # <<<<<<<<<<<<<<
10086  * refcount_objects_in_slice(self.data, self._shape,
10087  * self._strides, self.ndim, False)
10088  */
10089  __pyx_t_1 = (__pyx_v_self->dtype_is_object != 0);
10090  if (__pyx_t_1) {
10091 
10092  /* "View.MemoryView":216
10093  * elif self.free_data:
10094  * if self.dtype_is_object:
10095  * refcount_objects_in_slice(self.data, self._shape, # <<<<<<<<<<<<<<
10096  * self._strides, self.ndim, False)
10097  * free(self.data)
10098  */
10099  __pyx_memoryview_refcount_objects_in_slice(__pyx_v_self->data, __pyx_v_self->_shape, __pyx_v_self->_strides, __pyx_v_self->ndim, 0);
10100 
10101  /* "View.MemoryView":215
10102  * self.callback_free_data(self.data)
10103  * elif self.free_data:
10104  * if self.dtype_is_object: # <<<<<<<<<<<<<<
10105  * refcount_objects_in_slice(self.data, self._shape,
10106  * self._strides, self.ndim, False)
10107  */
10108  }
10109 
10110  /* "View.MemoryView":218
10111  * refcount_objects_in_slice(self.data, self._shape,
10112  * self._strides, self.ndim, False)
10113  * free(self.data) # <<<<<<<<<<<<<<
10114  * PyObject_Free(self._shape)
10115  *
10116  */
10117  free(__pyx_v_self->data);
10118 
10119  /* "View.MemoryView":214
10120  * if self.callback_free_data != NULL:
10121  * self.callback_free_data(self.data)
10122  * elif self.free_data: # <<<<<<<<<<<<<<
10123  * if self.dtype_is_object:
10124  * refcount_objects_in_slice(self.data, self._shape,
10125  */
10126  }
10127  __pyx_L3:;
10128 
10129  /* "View.MemoryView":219
10130  * self._strides, self.ndim, False)
10131  * free(self.data)
10132  * PyObject_Free(self._shape) # <<<<<<<<<<<<<<
10133  *
10134  * @property
10135  */
10136  PyObject_Free(__pyx_v_self->_shape);
10137 
10138  /* "View.MemoryView":211
10139  * __pyx_getbuffer = capsule(<void *> &__pyx_array_getbuffer, "getbuffer(obj, view, flags)")
10140  *
10141  * def __dealloc__(array self): # <<<<<<<<<<<<<<
10142  * if self.callback_free_data != NULL:
10143  * self.callback_free_data(self.data)
10144  */
10145 
10146  /* function exit code */
10147  __Pyx_RefNannyFinishContext();
10148 }
10149 
10150 /* "View.MemoryView":222
10151  *
10152  * @property
10153  * def memview(self): # <<<<<<<<<<<<<<
10154  * return self.get_memview()
10155  *
10156  */
10157 
10158 /* Python wrapper */
10159 static PyObject *__pyx_pw_15View_dot_MemoryView_5array_7memview_1__get__(PyObject *__pyx_v_self); /*proto*/
10160 static PyObject *__pyx_pw_15View_dot_MemoryView_5array_7memview_1__get__(PyObject *__pyx_v_self) {
10161  PyObject *__pyx_r = 0;
10162  __Pyx_RefNannyDeclarations
10163  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
10164  __pyx_r = __pyx_pf_15View_dot_MemoryView_5array_7memview___get__(((struct __pyx_array_obj *)__pyx_v_self));
10165 
10166  /* function exit code */
10167  __Pyx_RefNannyFinishContext();
10168  return __pyx_r;
10169 }
10170 
10171 static PyObject *__pyx_pf_15View_dot_MemoryView_5array_7memview___get__(struct __pyx_array_obj *__pyx_v_self) {
10172  PyObject *__pyx_r = NULL;
10173  __Pyx_RefNannyDeclarations
10174  PyObject *__pyx_t_1 = NULL;
10175  __Pyx_RefNannySetupContext("__get__", 0);
10176 
10177  /* "View.MemoryView":223
10178  * @property
10179  * def memview(self):
10180  * return self.get_memview() # <<<<<<<<<<<<<<
10181  *
10182  * @cname('get_memview')
10183  */
10184  __Pyx_XDECREF(__pyx_r);
10185  __pyx_t_1 = ((struct __pyx_vtabstruct_array *)__pyx_v_self->__pyx_vtab)->get_memview(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 223, __pyx_L1_error)
10186  __Pyx_GOTREF(__pyx_t_1);
10187  __pyx_r = __pyx_t_1;
10188  __pyx_t_1 = 0;
10189  goto __pyx_L0;
10190 
10191  /* "View.MemoryView":222
10192  *
10193  * @property
10194  * def memview(self): # <<<<<<<<<<<<<<
10195  * return self.get_memview()
10196  *
10197  */
10198 
10199  /* function exit code */
10200  __pyx_L1_error:;
10201  __Pyx_XDECREF(__pyx_t_1);
10202  __Pyx_AddTraceback("View.MemoryView.array.memview.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10203  __pyx_r = NULL;
10204  __pyx_L0:;
10205  __Pyx_XGIVEREF(__pyx_r);
10206  __Pyx_RefNannyFinishContext();
10207  return __pyx_r;
10208 }
10209 
10210 /* "View.MemoryView":226
10211  *
10212  * @cname('get_memview')
10213  * cdef get_memview(self): # <<<<<<<<<<<<<<
10214  * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE
10215  * return memoryview(self, flags, self.dtype_is_object)
10216  */
10217 
10218 static PyObject *__pyx_array_get_memview(struct __pyx_array_obj *__pyx_v_self) {
10219  int __pyx_v_flags;
10220  PyObject *__pyx_r = NULL;
10221  __Pyx_RefNannyDeclarations
10222  PyObject *__pyx_t_1 = NULL;
10223  PyObject *__pyx_t_2 = NULL;
10224  PyObject *__pyx_t_3 = NULL;
10225  __Pyx_RefNannySetupContext("get_memview", 0);
10226 
10227  /* "View.MemoryView":227
10228  * @cname('get_memview')
10229  * cdef get_memview(self):
10230  * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE # <<<<<<<<<<<<<<
10231  * return memoryview(self, flags, self.dtype_is_object)
10232  *
10233  */
10234  __pyx_v_flags = ((PyBUF_ANY_CONTIGUOUS | PyBUF_FORMAT) | PyBUF_WRITABLE);
10235 
10236  /* "View.MemoryView":228
10237  * cdef get_memview(self):
10238  * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE
10239  * return memoryview(self, flags, self.dtype_is_object) # <<<<<<<<<<<<<<
10240  *
10241  * def __len__(self):
10242  */
10243  __Pyx_XDECREF(__pyx_r);
10244  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 228, __pyx_L1_error)
10245  __Pyx_GOTREF(__pyx_t_1);
10246  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_self->dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 228, __pyx_L1_error)
10247  __Pyx_GOTREF(__pyx_t_2);
10248  __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 228, __pyx_L1_error)
10249  __Pyx_GOTREF(__pyx_t_3);
10250  __Pyx_INCREF(((PyObject *)__pyx_v_self));
10251  __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
10252  PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_self));
10253  __Pyx_GIVEREF(__pyx_t_1);
10254  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1);
10255  __Pyx_GIVEREF(__pyx_t_2);
10256  PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2);
10257  __pyx_t_1 = 0;
10258  __pyx_t_2 = 0;
10259  __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 228, __pyx_L1_error)
10260  __Pyx_GOTREF(__pyx_t_2);
10261  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
10262  __pyx_r = __pyx_t_2;
10263  __pyx_t_2 = 0;
10264  goto __pyx_L0;
10265 
10266  /* "View.MemoryView":226
10267  *
10268  * @cname('get_memview')
10269  * cdef get_memview(self): # <<<<<<<<<<<<<<
10270  * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE
10271  * return memoryview(self, flags, self.dtype_is_object)
10272  */
10273 
10274  /* function exit code */
10275  __pyx_L1_error:;
10276  __Pyx_XDECREF(__pyx_t_1);
10277  __Pyx_XDECREF(__pyx_t_2);
10278  __Pyx_XDECREF(__pyx_t_3);
10279  __Pyx_AddTraceback("View.MemoryView.array.get_memview", __pyx_clineno, __pyx_lineno, __pyx_filename);
10280  __pyx_r = 0;
10281  __pyx_L0:;
10282  __Pyx_XGIVEREF(__pyx_r);
10283  __Pyx_RefNannyFinishContext();
10284  return __pyx_r;
10285 }
10286 
10287 /* "View.MemoryView":230
10288  * return memoryview(self, flags, self.dtype_is_object)
10289  *
10290  * def __len__(self): # <<<<<<<<<<<<<<
10291  * return self._shape[0]
10292  *
10293  */
10294 
10295 /* Python wrapper */
10296 static Py_ssize_t __pyx_array___len__(PyObject *__pyx_v_self); /*proto*/
10297 static Py_ssize_t __pyx_array___len__(PyObject *__pyx_v_self) {
10298  Py_ssize_t __pyx_r;
10299  __Pyx_RefNannyDeclarations
10300  __Pyx_RefNannySetupContext("__len__ (wrapper)", 0);
10301  __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(((struct __pyx_array_obj *)__pyx_v_self));
10302 
10303  /* function exit code */
10304  __Pyx_RefNannyFinishContext();
10305  return __pyx_r;
10306 }
10307 
10308 static Py_ssize_t __pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(struct __pyx_array_obj *__pyx_v_self) {
10309  Py_ssize_t __pyx_r;
10310  __Pyx_RefNannyDeclarations
10311  __Pyx_RefNannySetupContext("__len__", 0);
10312 
10313  /* "View.MemoryView":231
10314  *
10315  * def __len__(self):
10316  * return self._shape[0] # <<<<<<<<<<<<<<
10317  *
10318  * def __getattr__(self, attr):
10319  */
10320  __pyx_r = (__pyx_v_self->_shape[0]);
10321  goto __pyx_L0;
10322 
10323  /* "View.MemoryView":230
10324  * return memoryview(self, flags, self.dtype_is_object)
10325  *
10326  * def __len__(self): # <<<<<<<<<<<<<<
10327  * return self._shape[0]
10328  *
10329  */
10330 
10331  /* function exit code */
10332  __pyx_L0:;
10333  __Pyx_RefNannyFinishContext();
10334  return __pyx_r;
10335 }
10336 
10337 /* "View.MemoryView":233
10338  * return self._shape[0]
10339  *
10340  * def __getattr__(self, attr): # <<<<<<<<<<<<<<
10341  * return getattr(self.memview, attr)
10342  *
10343  */
10344 
10345 /* Python wrapper */
10346 static PyObject *__pyx_array___getattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_attr); /*proto*/
10347 static PyObject *__pyx_array___getattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_attr) {
10348  PyObject *__pyx_r = 0;
10349  __Pyx_RefNannyDeclarations
10350  __Pyx_RefNannySetupContext("__getattr__ (wrapper)", 0);
10351  __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__(((struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_attr));
10352 
10353  /* function exit code */
10354  __Pyx_RefNannyFinishContext();
10355  return __pyx_r;
10356 }
10357 
10358 static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_attr) {
10359  PyObject *__pyx_r = NULL;
10360  __Pyx_RefNannyDeclarations
10361  PyObject *__pyx_t_1 = NULL;
10362  PyObject *__pyx_t_2 = NULL;
10363  __Pyx_RefNannySetupContext("__getattr__", 0);
10364 
10365  /* "View.MemoryView":234
10366  *
10367  * def __getattr__(self, attr):
10368  * return getattr(self.memview, attr) # <<<<<<<<<<<<<<
10369  *
10370  * def __getitem__(self, item):
10371  */
10372  __Pyx_XDECREF(__pyx_r);
10373  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 234, __pyx_L1_error)
10374  __Pyx_GOTREF(__pyx_t_1);
10375  __pyx_t_2 = __Pyx_GetAttr(__pyx_t_1, __pyx_v_attr); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 234, __pyx_L1_error)
10376  __Pyx_GOTREF(__pyx_t_2);
10377  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10378  __pyx_r = __pyx_t_2;
10379  __pyx_t_2 = 0;
10380  goto __pyx_L0;
10381 
10382  /* "View.MemoryView":233
10383  * return self._shape[0]
10384  *
10385  * def __getattr__(self, attr): # <<<<<<<<<<<<<<
10386  * return getattr(self.memview, attr)
10387  *
10388  */
10389 
10390  /* function exit code */
10391  __pyx_L1_error:;
10392  __Pyx_XDECREF(__pyx_t_1);
10393  __Pyx_XDECREF(__pyx_t_2);
10394  __Pyx_AddTraceback("View.MemoryView.array.__getattr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10395  __pyx_r = NULL;
10396  __pyx_L0:;
10397  __Pyx_XGIVEREF(__pyx_r);
10398  __Pyx_RefNannyFinishContext();
10399  return __pyx_r;
10400 }
10401 
10402 /* "View.MemoryView":236
10403  * return getattr(self.memview, attr)
10404  *
10405  * def __getitem__(self, item): # <<<<<<<<<<<<<<
10406  * return self.memview[item]
10407  *
10408  */
10409 
10410 /* Python wrapper */
10411 static PyObject *__pyx_array___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item); /*proto*/
10412 static PyObject *__pyx_array___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item) {
10413  PyObject *__pyx_r = 0;
10414  __Pyx_RefNannyDeclarations
10415  __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0);
10416  __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__(((struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_item));
10417 
10418  /* function exit code */
10419  __Pyx_RefNannyFinishContext();
10420  return __pyx_r;
10421 }
10422 
10423 static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item) {
10424  PyObject *__pyx_r = NULL;
10425  __Pyx_RefNannyDeclarations
10426  PyObject *__pyx_t_1 = NULL;
10427  PyObject *__pyx_t_2 = NULL;
10428  __Pyx_RefNannySetupContext("__getitem__", 0);
10429 
10430  /* "View.MemoryView":237
10431  *
10432  * def __getitem__(self, item):
10433  * return self.memview[item] # <<<<<<<<<<<<<<
10434  *
10435  * def __setitem__(self, item, value):
10436  */
10437  __Pyx_XDECREF(__pyx_r);
10438  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 237, __pyx_L1_error)
10439  __Pyx_GOTREF(__pyx_t_1);
10440  __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_t_1, __pyx_v_item); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 237, __pyx_L1_error)
10441  __Pyx_GOTREF(__pyx_t_2);
10442  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10443  __pyx_r = __pyx_t_2;
10444  __pyx_t_2 = 0;
10445  goto __pyx_L0;
10446 
10447  /* "View.MemoryView":236
10448  * return getattr(self.memview, attr)
10449  *
10450  * def __getitem__(self, item): # <<<<<<<<<<<<<<
10451  * return self.memview[item]
10452  *
10453  */
10454 
10455  /* function exit code */
10456  __pyx_L1_error:;
10457  __Pyx_XDECREF(__pyx_t_1);
10458  __Pyx_XDECREF(__pyx_t_2);
10459  __Pyx_AddTraceback("View.MemoryView.array.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10460  __pyx_r = NULL;
10461  __pyx_L0:;
10462  __Pyx_XGIVEREF(__pyx_r);
10463  __Pyx_RefNannyFinishContext();
10464  return __pyx_r;
10465 }
10466 
10467 /* "View.MemoryView":239
10468  * return self.memview[item]
10469  *
10470  * def __setitem__(self, item, value): # <<<<<<<<<<<<<<
10471  * self.memview[item] = value
10472  *
10473  */
10474 
10475 /* Python wrapper */
10476 static int __pyx_array___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value); /*proto*/
10477 static int __pyx_array___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value) {
10478  int __pyx_r;
10479  __Pyx_RefNannyDeclarations
10480  __Pyx_RefNannySetupContext("__setitem__ (wrapper)", 0);
10481  __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_12__setitem__(((struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_item), ((PyObject *)__pyx_v_value));
10482 
10483  /* function exit code */
10484  __Pyx_RefNannyFinishContext();
10485  return __pyx_r;
10486 }
10487 
10488 static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_12__setitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value) {
10489  int __pyx_r;
10490  __Pyx_RefNannyDeclarations
10491  PyObject *__pyx_t_1 = NULL;
10492  __Pyx_RefNannySetupContext("__setitem__", 0);
10493 
10494  /* "View.MemoryView":240
10495  *
10496  * def __setitem__(self, item, value):
10497  * self.memview[item] = value # <<<<<<<<<<<<<<
10498  *
10499  *
10500  */
10501  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 240, __pyx_L1_error)
10502  __Pyx_GOTREF(__pyx_t_1);
10503  if (unlikely(PyObject_SetItem(__pyx_t_1, __pyx_v_item, __pyx_v_value) < 0)) __PYX_ERR(2, 240, __pyx_L1_error)
10504  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10505 
10506  /* "View.MemoryView":239
10507  * return self.memview[item]
10508  *
10509  * def __setitem__(self, item, value): # <<<<<<<<<<<<<<
10510  * self.memview[item] = value
10511  *
10512  */
10513 
10514  /* function exit code */
10515  __pyx_r = 0;
10516  goto __pyx_L0;
10517  __pyx_L1_error:;
10518  __Pyx_XDECREF(__pyx_t_1);
10519  __Pyx_AddTraceback("View.MemoryView.array.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10520  __pyx_r = -1;
10521  __pyx_L0:;
10522  __Pyx_RefNannyFinishContext();
10523  return __pyx_r;
10524 }
10525 
10526 /* "(tree fragment)":1
10527  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
10528  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
10529  * def __setstate_cython__(self, __pyx_state):
10530  */
10531 
10532 /* Python wrapper */
10533 static PyObject *__pyx_pw___pyx_array_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
10534 static PyObject *__pyx_pw___pyx_array_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
10535  PyObject *__pyx_r = 0;
10536  __Pyx_RefNannyDeclarations
10537  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
10538  __pyx_r = __pyx_pf___pyx_array___reduce_cython__(((struct __pyx_array_obj *)__pyx_v_self));
10539 
10540  /* function exit code */
10541  __Pyx_RefNannyFinishContext();
10542  return __pyx_r;
10543 }
10544 
10545 static PyObject *__pyx_pf___pyx_array___reduce_cython__(CYTHON_UNUSED struct __pyx_array_obj *__pyx_v_self) {
10546  PyObject *__pyx_r = NULL;
10547  __Pyx_RefNannyDeclarations
10548  PyObject *__pyx_t_1 = NULL;
10549  __Pyx_RefNannySetupContext("__reduce_cython__", 0);
10550 
10551  /* "(tree fragment)":2
10552  * def __reduce_cython__(self):
10553  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
10554  * def __setstate_cython__(self, __pyx_state):
10555  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
10556  */
10557  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__13, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 2, __pyx_L1_error)
10558  __Pyx_GOTREF(__pyx_t_1);
10559  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
10560  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10561  __PYX_ERR(2, 2, __pyx_L1_error)
10562 
10563  /* "(tree fragment)":1
10564  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
10565  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
10566  * def __setstate_cython__(self, __pyx_state):
10567  */
10568 
10569  /* function exit code */
10570  __pyx_L1_error:;
10571  __Pyx_XDECREF(__pyx_t_1);
10572  __Pyx_AddTraceback("View.MemoryView.array.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10573  __pyx_r = NULL;
10574  __Pyx_XGIVEREF(__pyx_r);
10575  __Pyx_RefNannyFinishContext();
10576  return __pyx_r;
10577 }
10578 
10579 /* "(tree fragment)":3
10580  * def __reduce_cython__(self):
10581  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
10582  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
10583  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
10584  */
10585 
10586 /* Python wrapper */
10587 static PyObject *__pyx_pw___pyx_array_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
10588 static PyObject *__pyx_pw___pyx_array_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
10589  PyObject *__pyx_r = 0;
10590  __Pyx_RefNannyDeclarations
10591  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
10592  __pyx_r = __pyx_pf___pyx_array_2__setstate_cython__(((struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
10593 
10594  /* function exit code */
10595  __Pyx_RefNannyFinishContext();
10596  return __pyx_r;
10597 }
10598 
10599 static PyObject *__pyx_pf___pyx_array_2__setstate_cython__(CYTHON_UNUSED struct __pyx_array_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
10600  PyObject *__pyx_r = NULL;
10601  __Pyx_RefNannyDeclarations
10602  PyObject *__pyx_t_1 = NULL;
10603  __Pyx_RefNannySetupContext("__setstate_cython__", 0);
10604 
10605  /* "(tree fragment)":4
10606  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
10607  * def __setstate_cython__(self, __pyx_state):
10608  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
10609  */
10610  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__14, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 4, __pyx_L1_error)
10611  __Pyx_GOTREF(__pyx_t_1);
10612  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
10613  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10614  __PYX_ERR(2, 4, __pyx_L1_error)
10615 
10616  /* "(tree fragment)":3
10617  * def __reduce_cython__(self):
10618  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
10619  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
10620  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
10621  */
10622 
10623  /* function exit code */
10624  __pyx_L1_error:;
10625  __Pyx_XDECREF(__pyx_t_1);
10626  __Pyx_AddTraceback("View.MemoryView.array.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10627  __pyx_r = NULL;
10628  __Pyx_XGIVEREF(__pyx_r);
10629  __Pyx_RefNannyFinishContext();
10630  return __pyx_r;
10631 }
10632 
10633 /* "View.MemoryView":244
10634  *
10635  * @cname("__pyx_array_new")
10636  * cdef array array_cwrapper(tuple shape, Py_ssize_t itemsize, char *format, # <<<<<<<<<<<<<<
10637  * char *mode, char *buf):
10638  * cdef array result
10639  */
10640 
10641 static struct __pyx_array_obj *__pyx_array_new(PyObject *__pyx_v_shape, Py_ssize_t __pyx_v_itemsize, char *__pyx_v_format, char *__pyx_v_mode, char *__pyx_v_buf) {
10642  struct __pyx_array_obj *__pyx_v_result = 0;
10643  struct __pyx_array_obj *__pyx_r = NULL;
10644  __Pyx_RefNannyDeclarations
10645  int __pyx_t_1;
10646  PyObject *__pyx_t_2 = NULL;
10647  PyObject *__pyx_t_3 = NULL;
10648  PyObject *__pyx_t_4 = NULL;
10649  PyObject *__pyx_t_5 = NULL;
10650  __Pyx_RefNannySetupContext("array_cwrapper", 0);
10651 
10652  /* "View.MemoryView":248
10653  * cdef array result
10654  *
10655  * if buf == NULL: # <<<<<<<<<<<<<<
10656  * result = array(shape, itemsize, format, mode.decode('ASCII'))
10657  * else:
10658  */
10659  __pyx_t_1 = ((__pyx_v_buf == NULL) != 0);
10660  if (__pyx_t_1) {
10661 
10662  /* "View.MemoryView":249
10663  *
10664  * if buf == NULL:
10665  * result = array(shape, itemsize, format, mode.decode('ASCII')) # <<<<<<<<<<<<<<
10666  * else:
10667  * result = array(shape, itemsize, format, mode.decode('ASCII'),
10668  */
10669  __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_itemsize); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 249, __pyx_L1_error)
10670  __Pyx_GOTREF(__pyx_t_2);
10671  __pyx_t_3 = __Pyx_PyBytes_FromString(__pyx_v_format); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 249, __pyx_L1_error)
10672  __Pyx_GOTREF(__pyx_t_3);
10673  __pyx_t_4 = __Pyx_decode_c_string(__pyx_v_mode, 0, strlen(__pyx_v_mode), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 249, __pyx_L1_error)
10674  __Pyx_GOTREF(__pyx_t_4);
10675  __pyx_t_5 = PyTuple_New(4); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 249, __pyx_L1_error)
10676  __Pyx_GOTREF(__pyx_t_5);
10677  __Pyx_INCREF(__pyx_v_shape);
10678  __Pyx_GIVEREF(__pyx_v_shape);
10679  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_shape);
10680  __Pyx_GIVEREF(__pyx_t_2);
10681  PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_2);
10682  __Pyx_GIVEREF(__pyx_t_3);
10683  PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_3);
10684  __Pyx_GIVEREF(__pyx_t_4);
10685  PyTuple_SET_ITEM(__pyx_t_5, 3, __pyx_t_4);
10686  __pyx_t_2 = 0;
10687  __pyx_t_3 = 0;
10688  __pyx_t_4 = 0;
10689  __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)__pyx_array_type), __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 249, __pyx_L1_error)
10690  __Pyx_GOTREF(__pyx_t_4);
10691  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
10692  __pyx_v_result = ((struct __pyx_array_obj *)__pyx_t_4);
10693  __pyx_t_4 = 0;
10694 
10695  /* "View.MemoryView":248
10696  * cdef array result
10697  *
10698  * if buf == NULL: # <<<<<<<<<<<<<<
10699  * result = array(shape, itemsize, format, mode.decode('ASCII'))
10700  * else:
10701  */
10702  goto __pyx_L3;
10703  }
10704 
10705  /* "View.MemoryView":251
10706  * result = array(shape, itemsize, format, mode.decode('ASCII'))
10707  * else:
10708  * result = array(shape, itemsize, format, mode.decode('ASCII'), # <<<<<<<<<<<<<<
10709  * allocate_buffer=False)
10710  * result.data = buf
10711  */
10712  /*else*/ {
10713  __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_itemsize); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 251, __pyx_L1_error)
10714  __Pyx_GOTREF(__pyx_t_4);
10715  __pyx_t_5 = __Pyx_PyBytes_FromString(__pyx_v_format); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 251, __pyx_L1_error)
10716  __Pyx_GOTREF(__pyx_t_5);
10717  __pyx_t_3 = __Pyx_decode_c_string(__pyx_v_mode, 0, strlen(__pyx_v_mode), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 251, __pyx_L1_error)
10718  __Pyx_GOTREF(__pyx_t_3);
10719  __pyx_t_2 = PyTuple_New(4); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 251, __pyx_L1_error)
10720  __Pyx_GOTREF(__pyx_t_2);
10721  __Pyx_INCREF(__pyx_v_shape);
10722  __Pyx_GIVEREF(__pyx_v_shape);
10723  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_shape);
10724  __Pyx_GIVEREF(__pyx_t_4);
10725  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_4);
10726  __Pyx_GIVEREF(__pyx_t_5);
10727  PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_5);
10728  __Pyx_GIVEREF(__pyx_t_3);
10729  PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_t_3);
10730  __pyx_t_4 = 0;
10731  __pyx_t_5 = 0;
10732  __pyx_t_3 = 0;
10733 
10734  /* "View.MemoryView":252
10735  * else:
10736  * result = array(shape, itemsize, format, mode.decode('ASCII'),
10737  * allocate_buffer=False) # <<<<<<<<<<<<<<
10738  * result.data = buf
10739  *
10740  */
10741  __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 252, __pyx_L1_error)
10742  __Pyx_GOTREF(__pyx_t_3);
10743  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_allocate_buffer, Py_False) < 0) __PYX_ERR(2, 252, __pyx_L1_error)
10744 
10745  /* "View.MemoryView":251
10746  * result = array(shape, itemsize, format, mode.decode('ASCII'))
10747  * else:
10748  * result = array(shape, itemsize, format, mode.decode('ASCII'), # <<<<<<<<<<<<<<
10749  * allocate_buffer=False)
10750  * result.data = buf
10751  */
10752  __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)__pyx_array_type), __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 251, __pyx_L1_error)
10753  __Pyx_GOTREF(__pyx_t_5);
10754  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10755  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
10756  __pyx_v_result = ((struct __pyx_array_obj *)__pyx_t_5);
10757  __pyx_t_5 = 0;
10758 
10759  /* "View.MemoryView":253
10760  * result = array(shape, itemsize, format, mode.decode('ASCII'),
10761  * allocate_buffer=False)
10762  * result.data = buf # <<<<<<<<<<<<<<
10763  *
10764  * return result
10765  */
10766  __pyx_v_result->data = __pyx_v_buf;
10767  }
10768  __pyx_L3:;
10769 
10770  /* "View.MemoryView":255
10771  * result.data = buf
10772  *
10773  * return result # <<<<<<<<<<<<<<
10774  *
10775  *
10776  */
10777  __Pyx_XDECREF(((PyObject *)__pyx_r));
10778  __Pyx_INCREF(((PyObject *)__pyx_v_result));
10779  __pyx_r = __pyx_v_result;
10780  goto __pyx_L0;
10781 
10782  /* "View.MemoryView":244
10783  *
10784  * @cname("__pyx_array_new")
10785  * cdef array array_cwrapper(tuple shape, Py_ssize_t itemsize, char *format, # <<<<<<<<<<<<<<
10786  * char *mode, char *buf):
10787  * cdef array result
10788  */
10789 
10790  /* function exit code */
10791  __pyx_L1_error:;
10792  __Pyx_XDECREF(__pyx_t_2);
10793  __Pyx_XDECREF(__pyx_t_3);
10794  __Pyx_XDECREF(__pyx_t_4);
10795  __Pyx_XDECREF(__pyx_t_5);
10796  __Pyx_AddTraceback("View.MemoryView.array_cwrapper", __pyx_clineno, __pyx_lineno, __pyx_filename);
10797  __pyx_r = 0;
10798  __pyx_L0:;
10799  __Pyx_XDECREF((PyObject *)__pyx_v_result);
10800  __Pyx_XGIVEREF((PyObject *)__pyx_r);
10801  __Pyx_RefNannyFinishContext();
10802  return __pyx_r;
10803 }
10804 
10805 /* "View.MemoryView":281
10806  * cdef class Enum(object):
10807  * cdef object name
10808  * def __init__(self, name): # <<<<<<<<<<<<<<
10809  * self.name = name
10810  * def __repr__(self):
10811  */
10812 
10813 /* Python wrapper */
10814 static int __pyx_MemviewEnum___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
10815 static int __pyx_MemviewEnum___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
10816  PyObject *__pyx_v_name = 0;
10817  int __pyx_r;
10818  __Pyx_RefNannyDeclarations
10819  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
10820  {
10821  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_name,0};
10822  PyObject* values[1] = {0};
10823  if (unlikely(__pyx_kwds)) {
10824  Py_ssize_t kw_args;
10825  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
10826  switch (pos_args) {
10827  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
10828  CYTHON_FALLTHROUGH;
10829  case 0: break;
10830  default: goto __pyx_L5_argtuple_error;
10831  }
10832  kw_args = PyDict_Size(__pyx_kwds);
10833  switch (pos_args) {
10834  case 0:
10835  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_name)) != 0)) kw_args--;
10836  else goto __pyx_L5_argtuple_error;
10837  }
10838  if (unlikely(kw_args > 0)) {
10839  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(2, 281, __pyx_L3_error)
10840  }
10841  } else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
10842  goto __pyx_L5_argtuple_error;
10843  } else {
10844  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
10845  }
10846  __pyx_v_name = values[0];
10847  }
10848  goto __pyx_L4_argument_unpacking_done;
10849  __pyx_L5_argtuple_error:;
10850  __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 281, __pyx_L3_error)
10851  __pyx_L3_error:;
10852  __Pyx_AddTraceback("View.MemoryView.Enum.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10853  __Pyx_RefNannyFinishContext();
10854  return -1;
10855  __pyx_L4_argument_unpacking_done:;
10856  __pyx_r = __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(((struct __pyx_MemviewEnum_obj *)__pyx_v_self), __pyx_v_name);
10857 
10858  /* function exit code */
10859  __Pyx_RefNannyFinishContext();
10860  return __pyx_r;
10861 }
10862 
10863 static int __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v_name) {
10864  int __pyx_r;
10865  __Pyx_RefNannyDeclarations
10866  __Pyx_RefNannySetupContext("__init__", 0);
10867 
10868  /* "View.MemoryView":282
10869  * cdef object name
10870  * def __init__(self, name):
10871  * self.name = name # <<<<<<<<<<<<<<
10872  * def __repr__(self):
10873  * return self.name
10874  */
10875  __Pyx_INCREF(__pyx_v_name);
10876  __Pyx_GIVEREF(__pyx_v_name);
10877  __Pyx_GOTREF(__pyx_v_self->name);
10878  __Pyx_DECREF(__pyx_v_self->name);
10879  __pyx_v_self->name = __pyx_v_name;
10880 
10881  /* "View.MemoryView":281
10882  * cdef class Enum(object):
10883  * cdef object name
10884  * def __init__(self, name): # <<<<<<<<<<<<<<
10885  * self.name = name
10886  * def __repr__(self):
10887  */
10888 
10889  /* function exit code */
10890  __pyx_r = 0;
10891  __Pyx_RefNannyFinishContext();
10892  return __pyx_r;
10893 }
10894 
10895 /* "View.MemoryView":283
10896  * def __init__(self, name):
10897  * self.name = name
10898  * def __repr__(self): # <<<<<<<<<<<<<<
10899  * return self.name
10900  *
10901  */
10902 
10903 /* Python wrapper */
10904 static PyObject *__pyx_MemviewEnum___repr__(PyObject *__pyx_v_self); /*proto*/
10905 static PyObject *__pyx_MemviewEnum___repr__(PyObject *__pyx_v_self) {
10906  PyObject *__pyx_r = 0;
10907  __Pyx_RefNannyDeclarations
10908  __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
10909  __pyx_r = __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(((struct __pyx_MemviewEnum_obj *)__pyx_v_self));
10910 
10911  /* function exit code */
10912  __Pyx_RefNannyFinishContext();
10913  return __pyx_r;
10914 }
10915 
10916 static PyObject *__pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(struct __pyx_MemviewEnum_obj *__pyx_v_self) {
10917  PyObject *__pyx_r = NULL;
10918  __Pyx_RefNannyDeclarations
10919  __Pyx_RefNannySetupContext("__repr__", 0);
10920 
10921  /* "View.MemoryView":284
10922  * self.name = name
10923  * def __repr__(self):
10924  * return self.name # <<<<<<<<<<<<<<
10925  *
10926  * cdef generic = Enum("<strided and direct or indirect>")
10927  */
10928  __Pyx_XDECREF(__pyx_r);
10929  __Pyx_INCREF(__pyx_v_self->name);
10930  __pyx_r = __pyx_v_self->name;
10931  goto __pyx_L0;
10932 
10933  /* "View.MemoryView":283
10934  * def __init__(self, name):
10935  * self.name = name
10936  * def __repr__(self): # <<<<<<<<<<<<<<
10937  * return self.name
10938  *
10939  */
10940 
10941  /* function exit code */
10942  __pyx_L0:;
10943  __Pyx_XGIVEREF(__pyx_r);
10944  __Pyx_RefNannyFinishContext();
10945  return __pyx_r;
10946 }
10947 
10948 /* "(tree fragment)":1
10949  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
10950  * cdef tuple state
10951  * cdef object _dict
10952  */
10953 
10954 /* Python wrapper */
10955 static PyObject *__pyx_pw___pyx_MemviewEnum_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
10956 static PyObject *__pyx_pw___pyx_MemviewEnum_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
10957  PyObject *__pyx_r = 0;
10958  __Pyx_RefNannyDeclarations
10959  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
10960  __pyx_r = __pyx_pf___pyx_MemviewEnum___reduce_cython__(((struct __pyx_MemviewEnum_obj *)__pyx_v_self));
10961 
10962  /* function exit code */
10963  __Pyx_RefNannyFinishContext();
10964  return __pyx_r;
10965 }
10966 
10967 static PyObject *__pyx_pf___pyx_MemviewEnum___reduce_cython__(struct __pyx_MemviewEnum_obj *__pyx_v_self) {
10968  PyObject *__pyx_v_state = 0;
10969  PyObject *__pyx_v__dict = 0;
10970  int __pyx_v_use_setstate;
10971  PyObject *__pyx_r = NULL;
10972  __Pyx_RefNannyDeclarations
10973  PyObject *__pyx_t_1 = NULL;
10974  int __pyx_t_2;
10975  int __pyx_t_3;
10976  PyObject *__pyx_t_4 = NULL;
10977  PyObject *__pyx_t_5 = NULL;
10978  __Pyx_RefNannySetupContext("__reduce_cython__", 0);
10979 
10980  /* "(tree fragment)":5
10981  * cdef object _dict
10982  * cdef bint use_setstate
10983  * state = (self.name,) # <<<<<<<<<<<<<<
10984  * _dict = getattr(self, '__dict__', None)
10985  * if _dict is not None:
10986  */
10987  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 5, __pyx_L1_error)
10988  __Pyx_GOTREF(__pyx_t_1);
10989  __Pyx_INCREF(__pyx_v_self->name);
10990  __Pyx_GIVEREF(__pyx_v_self->name);
10991  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_self->name);
10992  __pyx_v_state = ((PyObject*)__pyx_t_1);
10993  __pyx_t_1 = 0;
10994 
10995  /* "(tree fragment)":6
10996  * cdef bint use_setstate
10997  * state = (self.name,)
10998  * _dict = getattr(self, '__dict__', None) # <<<<<<<<<<<<<<
10999  * if _dict is not None:
11000  * state += (_dict,)
11001  */
11002  __pyx_t_1 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_n_s_dict, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 6, __pyx_L1_error)
11003  __Pyx_GOTREF(__pyx_t_1);
11004  __pyx_v__dict = __pyx_t_1;
11005  __pyx_t_1 = 0;
11006 
11007  /* "(tree fragment)":7
11008  * state = (self.name,)
11009  * _dict = getattr(self, '__dict__', None)
11010  * if _dict is not None: # <<<<<<<<<<<<<<
11011  * state += (_dict,)
11012  * use_setstate = True
11013  */
11014  __pyx_t_2 = (__pyx_v__dict != Py_None);
11015  __pyx_t_3 = (__pyx_t_2 != 0);
11016  if (__pyx_t_3) {
11017 
11018  /* "(tree fragment)":8
11019  * _dict = getattr(self, '__dict__', None)
11020  * if _dict is not None:
11021  * state += (_dict,) # <<<<<<<<<<<<<<
11022  * use_setstate = True
11023  * else:
11024  */
11025  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 8, __pyx_L1_error)
11026  __Pyx_GOTREF(__pyx_t_1);
11027  __Pyx_INCREF(__pyx_v__dict);
11028  __Pyx_GIVEREF(__pyx_v__dict);
11029  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v__dict);
11030  __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 8, __pyx_L1_error)
11031  __Pyx_GOTREF(__pyx_t_4);
11032  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11033  __Pyx_DECREF_SET(__pyx_v_state, ((PyObject*)__pyx_t_4));
11034  __pyx_t_4 = 0;
11035 
11036  /* "(tree fragment)":9
11037  * if _dict is not None:
11038  * state += (_dict,)
11039  * use_setstate = True # <<<<<<<<<<<<<<
11040  * else:
11041  * use_setstate = self.name is not None
11042  */
11043  __pyx_v_use_setstate = 1;
11044 
11045  /* "(tree fragment)":7
11046  * state = (self.name,)
11047  * _dict = getattr(self, '__dict__', None)
11048  * if _dict is not None: # <<<<<<<<<<<<<<
11049  * state += (_dict,)
11050  * use_setstate = True
11051  */
11052  goto __pyx_L3;
11053  }
11054 
11055  /* "(tree fragment)":11
11056  * use_setstate = True
11057  * else:
11058  * use_setstate = self.name is not None # <<<<<<<<<<<<<<
11059  * if use_setstate:
11060  * return __pyx_unpickle_Enum, (type(self), 0xb068931, None), state
11061  */
11062  /*else*/ {
11063  __pyx_t_3 = (__pyx_v_self->name != Py_None);
11064  __pyx_v_use_setstate = __pyx_t_3;
11065  }
11066  __pyx_L3:;
11067 
11068  /* "(tree fragment)":12
11069  * else:
11070  * use_setstate = self.name is not None
11071  * if use_setstate: # <<<<<<<<<<<<<<
11072  * return __pyx_unpickle_Enum, (type(self), 0xb068931, None), state
11073  * else:
11074  */
11075  __pyx_t_3 = (__pyx_v_use_setstate != 0);
11076  if (__pyx_t_3) {
11077 
11078  /* "(tree fragment)":13
11079  * use_setstate = self.name is not None
11080  * if use_setstate:
11081  * return __pyx_unpickle_Enum, (type(self), 0xb068931, None), state # <<<<<<<<<<<<<<
11082  * else:
11083  * return __pyx_unpickle_Enum, (type(self), 0xb068931, state)
11084  */
11085  __Pyx_XDECREF(__pyx_r);
11086  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_pyx_unpickle_Enum); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 13, __pyx_L1_error)
11087  __Pyx_GOTREF(__pyx_t_4);
11088  __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 13, __pyx_L1_error)
11089  __Pyx_GOTREF(__pyx_t_1);
11090  __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
11091  __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
11092  PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
11093  __Pyx_INCREF(__pyx_int_184977713);
11094  __Pyx_GIVEREF(__pyx_int_184977713);
11095  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_184977713);
11096  __Pyx_INCREF(Py_None);
11097  __Pyx_GIVEREF(Py_None);
11098  PyTuple_SET_ITEM(__pyx_t_1, 2, Py_None);
11099  __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 13, __pyx_L1_error)
11100  __Pyx_GOTREF(__pyx_t_5);
11101  __Pyx_GIVEREF(__pyx_t_4);
11102  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4);
11103  __Pyx_GIVEREF(__pyx_t_1);
11104  PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_1);
11105  __Pyx_INCREF(__pyx_v_state);
11106  __Pyx_GIVEREF(__pyx_v_state);
11107  PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_v_state);
11108  __pyx_t_4 = 0;
11109  __pyx_t_1 = 0;
11110  __pyx_r = __pyx_t_5;
11111  __pyx_t_5 = 0;
11112  goto __pyx_L0;
11113 
11114  /* "(tree fragment)":12
11115  * else:
11116  * use_setstate = self.name is not None
11117  * if use_setstate: # <<<<<<<<<<<<<<
11118  * return __pyx_unpickle_Enum, (type(self), 0xb068931, None), state
11119  * else:
11120  */
11121  }
11122 
11123  /* "(tree fragment)":15
11124  * return __pyx_unpickle_Enum, (type(self), 0xb068931, None), state
11125  * else:
11126  * return __pyx_unpickle_Enum, (type(self), 0xb068931, state) # <<<<<<<<<<<<<<
11127  * def __setstate_cython__(self, __pyx_state):
11128  * __pyx_unpickle_Enum__set_state(self, __pyx_state)
11129  */
11130  /*else*/ {
11131  __Pyx_XDECREF(__pyx_r);
11132  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_pyx_unpickle_Enum); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 15, __pyx_L1_error)
11133  __Pyx_GOTREF(__pyx_t_5);
11134  __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 15, __pyx_L1_error)
11135  __Pyx_GOTREF(__pyx_t_1);
11136  __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
11137  __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
11138  PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
11139  __Pyx_INCREF(__pyx_int_184977713);
11140  __Pyx_GIVEREF(__pyx_int_184977713);
11141  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_184977713);
11142  __Pyx_INCREF(__pyx_v_state);
11143  __Pyx_GIVEREF(__pyx_v_state);
11144  PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_state);
11145  __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 15, __pyx_L1_error)
11146  __Pyx_GOTREF(__pyx_t_4);
11147  __Pyx_GIVEREF(__pyx_t_5);
11148  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5);
11149  __Pyx_GIVEREF(__pyx_t_1);
11150  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1);
11151  __pyx_t_5 = 0;
11152  __pyx_t_1 = 0;
11153  __pyx_r = __pyx_t_4;
11154  __pyx_t_4 = 0;
11155  goto __pyx_L0;
11156  }
11157 
11158  /* "(tree fragment)":1
11159  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
11160  * cdef tuple state
11161  * cdef object _dict
11162  */
11163 
11164  /* function exit code */
11165  __pyx_L1_error:;
11166  __Pyx_XDECREF(__pyx_t_1);
11167  __Pyx_XDECREF(__pyx_t_4);
11168  __Pyx_XDECREF(__pyx_t_5);
11169  __Pyx_AddTraceback("View.MemoryView.Enum.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11170  __pyx_r = NULL;
11171  __pyx_L0:;
11172  __Pyx_XDECREF(__pyx_v_state);
11173  __Pyx_XDECREF(__pyx_v__dict);
11174  __Pyx_XGIVEREF(__pyx_r);
11175  __Pyx_RefNannyFinishContext();
11176  return __pyx_r;
11177 }
11178 
11179 /* "(tree fragment)":16
11180  * else:
11181  * return __pyx_unpickle_Enum, (type(self), 0xb068931, state)
11182  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
11183  * __pyx_unpickle_Enum__set_state(self, __pyx_state)
11184  */
11185 
11186 /* Python wrapper */
11187 static PyObject *__pyx_pw___pyx_MemviewEnum_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
11188 static PyObject *__pyx_pw___pyx_MemviewEnum_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
11189  PyObject *__pyx_r = 0;
11190  __Pyx_RefNannyDeclarations
11191  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
11192  __pyx_r = __pyx_pf___pyx_MemviewEnum_2__setstate_cython__(((struct __pyx_MemviewEnum_obj *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
11193 
11194  /* function exit code */
11195  __Pyx_RefNannyFinishContext();
11196  return __pyx_r;
11197 }
11198 
11199 static PyObject *__pyx_pf___pyx_MemviewEnum_2__setstate_cython__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
11200  PyObject *__pyx_r = NULL;
11201  __Pyx_RefNannyDeclarations
11202  PyObject *__pyx_t_1 = NULL;
11203  __Pyx_RefNannySetupContext("__setstate_cython__", 0);
11204 
11205  /* "(tree fragment)":17
11206  * return __pyx_unpickle_Enum, (type(self), 0xb068931, state)
11207  * def __setstate_cython__(self, __pyx_state):
11208  * __pyx_unpickle_Enum__set_state(self, __pyx_state) # <<<<<<<<<<<<<<
11209  */
11210  if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(2, 17, __pyx_L1_error)
11211  __pyx_t_1 = __pyx_unpickle_Enum__set_state(__pyx_v_self, ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 17, __pyx_L1_error)
11212  __Pyx_GOTREF(__pyx_t_1);
11213  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11214 
11215  /* "(tree fragment)":16
11216  * else:
11217  * return __pyx_unpickle_Enum, (type(self), 0xb068931, state)
11218  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
11219  * __pyx_unpickle_Enum__set_state(self, __pyx_state)
11220  */
11221 
11222  /* function exit code */
11223  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
11224  goto __pyx_L0;
11225  __pyx_L1_error:;
11226  __Pyx_XDECREF(__pyx_t_1);
11227  __Pyx_AddTraceback("View.MemoryView.Enum.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11228  __pyx_r = NULL;
11229  __pyx_L0:;
11230  __Pyx_XGIVEREF(__pyx_r);
11231  __Pyx_RefNannyFinishContext();
11232  return __pyx_r;
11233 }
11234 
11235 /* "View.MemoryView":298
11236  *
11237  * @cname('__pyx_align_pointer')
11238  * cdef void *align_pointer(void *memory, size_t alignment) nogil: # <<<<<<<<<<<<<<
11239  * "Align pointer memory on a given boundary"
11240  * cdef Py_intptr_t aligned_p = <Py_intptr_t> memory
11241  */
11242 
11243 static void *__pyx_align_pointer(void *__pyx_v_memory, size_t __pyx_v_alignment) {
11244  Py_intptr_t __pyx_v_aligned_p;
11245  size_t __pyx_v_offset;
11246  void *__pyx_r;
11247  int __pyx_t_1;
11248 
11249  /* "View.MemoryView":300
11250  * cdef void *align_pointer(void *memory, size_t alignment) nogil:
11251  * "Align pointer memory on a given boundary"
11252  * cdef Py_intptr_t aligned_p = <Py_intptr_t> memory # <<<<<<<<<<<<<<
11253  * cdef size_t offset
11254  *
11255  */
11256  __pyx_v_aligned_p = ((Py_intptr_t)__pyx_v_memory);
11257 
11258  /* "View.MemoryView":304
11259  *
11260  * with cython.cdivision(True):
11261  * offset = aligned_p % alignment # <<<<<<<<<<<<<<
11262  *
11263  * if offset > 0:
11264  */
11265  __pyx_v_offset = (__pyx_v_aligned_p % __pyx_v_alignment);
11266 
11267  /* "View.MemoryView":306
11268  * offset = aligned_p % alignment
11269  *
11270  * if offset > 0: # <<<<<<<<<<<<<<
11271  * aligned_p += alignment - offset
11272  *
11273  */
11274  __pyx_t_1 = ((__pyx_v_offset > 0) != 0);
11275  if (__pyx_t_1) {
11276 
11277  /* "View.MemoryView":307
11278  *
11279  * if offset > 0:
11280  * aligned_p += alignment - offset # <<<<<<<<<<<<<<
11281  *
11282  * return <void *> aligned_p
11283  */
11284  __pyx_v_aligned_p = (__pyx_v_aligned_p + (__pyx_v_alignment - __pyx_v_offset));
11285 
11286  /* "View.MemoryView":306
11287  * offset = aligned_p % alignment
11288  *
11289  * if offset > 0: # <<<<<<<<<<<<<<
11290  * aligned_p += alignment - offset
11291  *
11292  */
11293  }
11294 
11295  /* "View.MemoryView":309
11296  * aligned_p += alignment - offset
11297  *
11298  * return <void *> aligned_p # <<<<<<<<<<<<<<
11299  *
11300  *
11301  */
11302  __pyx_r = ((void *)__pyx_v_aligned_p);
11303  goto __pyx_L0;
11304 
11305  /* "View.MemoryView":298
11306  *
11307  * @cname('__pyx_align_pointer')
11308  * cdef void *align_pointer(void *memory, size_t alignment) nogil: # <<<<<<<<<<<<<<
11309  * "Align pointer memory on a given boundary"
11310  * cdef Py_intptr_t aligned_p = <Py_intptr_t> memory
11311  */
11312 
11313  /* function exit code */
11314  __pyx_L0:;
11315  return __pyx_r;
11316 }
11317 
11318 /* "View.MemoryView":345
11319  * cdef __Pyx_TypeInfo *typeinfo
11320  *
11321  * def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False): # <<<<<<<<<<<<<<
11322  * self.obj = obj
11323  * self.flags = flags
11324  */
11325 
11326 /* Python wrapper */
11327 static int __pyx_memoryview___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
11328 static int __pyx_memoryview___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
11329  PyObject *__pyx_v_obj = 0;
11330  int __pyx_v_flags;
11331  int __pyx_v_dtype_is_object;
11332  int __pyx_r;
11333  __Pyx_RefNannyDeclarations
11334  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
11335  {
11336  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_obj,&__pyx_n_s_flags,&__pyx_n_s_dtype_is_object,0};
11337  PyObject* values[3] = {0,0,0};
11338  if (unlikely(__pyx_kwds)) {
11339  Py_ssize_t kw_args;
11340  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
11341  switch (pos_args) {
11342  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
11343  CYTHON_FALLTHROUGH;
11344  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
11345  CYTHON_FALLTHROUGH;
11346  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
11347  CYTHON_FALLTHROUGH;
11348  case 0: break;
11349  default: goto __pyx_L5_argtuple_error;
11350  }
11351  kw_args = PyDict_Size(__pyx_kwds);
11352  switch (pos_args) {
11353  case 0:
11354  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_obj)) != 0)) kw_args--;
11355  else goto __pyx_L5_argtuple_error;
11356  CYTHON_FALLTHROUGH;
11357  case 1:
11358  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_flags)) != 0)) kw_args--;
11359  else {
11360  __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 3, 1); __PYX_ERR(2, 345, __pyx_L3_error)
11361  }
11362  CYTHON_FALLTHROUGH;
11363  case 2:
11364  if (kw_args > 0) {
11365  PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dtype_is_object);
11366  if (value) { values[2] = value; kw_args--; }
11367  }
11368  }
11369  if (unlikely(kw_args > 0)) {
11370  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(2, 345, __pyx_L3_error)
11371  }
11372  } else {
11373  switch (PyTuple_GET_SIZE(__pyx_args)) {
11374  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
11375  CYTHON_FALLTHROUGH;
11376  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
11377  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
11378  break;
11379  default: goto __pyx_L5_argtuple_error;
11380  }
11381  }
11382  __pyx_v_obj = values[0];
11383  __pyx_v_flags = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_flags == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 345, __pyx_L3_error)
11384  if (values[2]) {
11385  __pyx_v_dtype_is_object = __Pyx_PyObject_IsTrue(values[2]); if (unlikely((__pyx_v_dtype_is_object == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 345, __pyx_L3_error)
11386  } else {
11387  __pyx_v_dtype_is_object = ((int)0);
11388  }
11389  }
11390  goto __pyx_L4_argument_unpacking_done;
11391  __pyx_L5_argtuple_error:;
11392  __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 345, __pyx_L3_error)
11393  __pyx_L3_error:;
11394  __Pyx_AddTraceback("View.MemoryView.memoryview.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11395  __Pyx_RefNannyFinishContext();
11396  return -1;
11397  __pyx_L4_argument_unpacking_done:;
11398  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit__(((struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_obj, __pyx_v_flags, __pyx_v_dtype_is_object);
11399 
11400  /* function exit code */
11401  __Pyx_RefNannyFinishContext();
11402  return __pyx_r;
11403 }
11404 
11405 static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj, int __pyx_v_flags, int __pyx_v_dtype_is_object) {
11406  int __pyx_r;
11407  __Pyx_RefNannyDeclarations
11408  int __pyx_t_1;
11409  int __pyx_t_2;
11410  int __pyx_t_3;
11411  int __pyx_t_4;
11412  __Pyx_RefNannySetupContext("__cinit__", 0);
11413 
11414  /* "View.MemoryView":346
11415  *
11416  * def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False):
11417  * self.obj = obj # <<<<<<<<<<<<<<
11418  * self.flags = flags
11419  * if type(self) is memoryview or obj is not None:
11420  */
11421  __Pyx_INCREF(__pyx_v_obj);
11422  __Pyx_GIVEREF(__pyx_v_obj);
11423  __Pyx_GOTREF(__pyx_v_self->obj);
11424  __Pyx_DECREF(__pyx_v_self->obj);
11425  __pyx_v_self->obj = __pyx_v_obj;
11426 
11427  /* "View.MemoryView":347
11428  * def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False):
11429  * self.obj = obj
11430  * self.flags = flags # <<<<<<<<<<<<<<
11431  * if type(self) is memoryview or obj is not None:
11432  * __Pyx_GetBuffer(obj, &self.view, flags)
11433  */
11434  __pyx_v_self->flags = __pyx_v_flags;
11435 
11436  /* "View.MemoryView":348
11437  * self.obj = obj
11438  * self.flags = flags
11439  * if type(self) is memoryview or obj is not None: # <<<<<<<<<<<<<<
11440  * __Pyx_GetBuffer(obj, &self.view, flags)
11441  * if <PyObject *> self.view.obj == NULL:
11442  */
11443  __pyx_t_2 = (((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))) == ((PyObject *)__pyx_memoryview_type));
11444  __pyx_t_3 = (__pyx_t_2 != 0);
11445  if (!__pyx_t_3) {
11446  } else {
11447  __pyx_t_1 = __pyx_t_3;
11448  goto __pyx_L4_bool_binop_done;
11449  }
11450  __pyx_t_3 = (__pyx_v_obj != Py_None);
11451  __pyx_t_2 = (__pyx_t_3 != 0);
11452  __pyx_t_1 = __pyx_t_2;
11453  __pyx_L4_bool_binop_done:;
11454  if (__pyx_t_1) {
11455 
11456  /* "View.MemoryView":349
11457  * self.flags = flags
11458  * if type(self) is memoryview or obj is not None:
11459  * __Pyx_GetBuffer(obj, &self.view, flags) # <<<<<<<<<<<<<<
11460  * if <PyObject *> self.view.obj == NULL:
11461  * (<__pyx_buffer *> &self.view).obj = Py_None
11462  */
11463  __pyx_t_4 = __Pyx_GetBuffer(__pyx_v_obj, (&__pyx_v_self->view), __pyx_v_flags); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(2, 349, __pyx_L1_error)
11464 
11465  /* "View.MemoryView":350
11466  * if type(self) is memoryview or obj is not None:
11467  * __Pyx_GetBuffer(obj, &self.view, flags)
11468  * if <PyObject *> self.view.obj == NULL: # <<<<<<<<<<<<<<
11469  * (<__pyx_buffer *> &self.view).obj = Py_None
11470  * Py_INCREF(Py_None)
11471  */
11472  __pyx_t_1 = ((((PyObject *)__pyx_v_self->view.obj) == NULL) != 0);
11473  if (__pyx_t_1) {
11474 
11475  /* "View.MemoryView":351
11476  * __Pyx_GetBuffer(obj, &self.view, flags)
11477  * if <PyObject *> self.view.obj == NULL:
11478  * (<__pyx_buffer *> &self.view).obj = Py_None # <<<<<<<<<<<<<<
11479  * Py_INCREF(Py_None)
11480  *
11481  */
11482  ((Py_buffer *)(&__pyx_v_self->view))->obj = Py_None;
11483 
11484  /* "View.MemoryView":352
11485  * if <PyObject *> self.view.obj == NULL:
11486  * (<__pyx_buffer *> &self.view).obj = Py_None
11487  * Py_INCREF(Py_None) # <<<<<<<<<<<<<<
11488  *
11489  * global __pyx_memoryview_thread_locks_used
11490  */
11491  Py_INCREF(Py_None);
11492 
11493  /* "View.MemoryView":350
11494  * if type(self) is memoryview or obj is not None:
11495  * __Pyx_GetBuffer(obj, &self.view, flags)
11496  * if <PyObject *> self.view.obj == NULL: # <<<<<<<<<<<<<<
11497  * (<__pyx_buffer *> &self.view).obj = Py_None
11498  * Py_INCREF(Py_None)
11499  */
11500  }
11501 
11502  /* "View.MemoryView":348
11503  * self.obj = obj
11504  * self.flags = flags
11505  * if type(self) is memoryview or obj is not None: # <<<<<<<<<<<<<<
11506  * __Pyx_GetBuffer(obj, &self.view, flags)
11507  * if <PyObject *> self.view.obj == NULL:
11508  */
11509  }
11510 
11511  /* "View.MemoryView":355
11512  *
11513  * global __pyx_memoryview_thread_locks_used
11514  * if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED: # <<<<<<<<<<<<<<
11515  * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
11516  * __pyx_memoryview_thread_locks_used += 1
11517  */
11518  __pyx_t_1 = ((__pyx_memoryview_thread_locks_used < 8) != 0);
11519  if (__pyx_t_1) {
11520 
11521  /* "View.MemoryView":356
11522  * global __pyx_memoryview_thread_locks_used
11523  * if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED:
11524  * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] # <<<<<<<<<<<<<<
11525  * __pyx_memoryview_thread_locks_used += 1
11526  * if self.lock is NULL:
11527  */
11528  __pyx_v_self->lock = (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]);
11529 
11530  /* "View.MemoryView":357
11531  * if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED:
11532  * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
11533  * __pyx_memoryview_thread_locks_used += 1 # <<<<<<<<<<<<<<
11534  * if self.lock is NULL:
11535  * self.lock = PyThread_allocate_lock()
11536  */
11537  __pyx_memoryview_thread_locks_used = (__pyx_memoryview_thread_locks_used + 1);
11538 
11539  /* "View.MemoryView":355
11540  *
11541  * global __pyx_memoryview_thread_locks_used
11542  * if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED: # <<<<<<<<<<<<<<
11543  * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
11544  * __pyx_memoryview_thread_locks_used += 1
11545  */
11546  }
11547 
11548  /* "View.MemoryView":358
11549  * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
11550  * __pyx_memoryview_thread_locks_used += 1
11551  * if self.lock is NULL: # <<<<<<<<<<<<<<
11552  * self.lock = PyThread_allocate_lock()
11553  * if self.lock is NULL:
11554  */
11555  __pyx_t_1 = ((__pyx_v_self->lock == NULL) != 0);
11556  if (__pyx_t_1) {
11557 
11558  /* "View.MemoryView":359
11559  * __pyx_memoryview_thread_locks_used += 1
11560  * if self.lock is NULL:
11561  * self.lock = PyThread_allocate_lock() # <<<<<<<<<<<<<<
11562  * if self.lock is NULL:
11563  * raise MemoryError
11564  */
11565  __pyx_v_self->lock = PyThread_allocate_lock();
11566 
11567  /* "View.MemoryView":360
11568  * if self.lock is NULL:
11569  * self.lock = PyThread_allocate_lock()
11570  * if self.lock is NULL: # <<<<<<<<<<<<<<
11571  * raise MemoryError
11572  *
11573  */
11574  __pyx_t_1 = ((__pyx_v_self->lock == NULL) != 0);
11575  if (unlikely(__pyx_t_1)) {
11576 
11577  /* "View.MemoryView":361
11578  * self.lock = PyThread_allocate_lock()
11579  * if self.lock is NULL:
11580  * raise MemoryError # <<<<<<<<<<<<<<
11581  *
11582  * if flags & PyBUF_FORMAT:
11583  */
11584  PyErr_NoMemory(); __PYX_ERR(2, 361, __pyx_L1_error)
11585 
11586  /* "View.MemoryView":360
11587  * if self.lock is NULL:
11588  * self.lock = PyThread_allocate_lock()
11589  * if self.lock is NULL: # <<<<<<<<<<<<<<
11590  * raise MemoryError
11591  *
11592  */
11593  }
11594 
11595  /* "View.MemoryView":358
11596  * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
11597  * __pyx_memoryview_thread_locks_used += 1
11598  * if self.lock is NULL: # <<<<<<<<<<<<<<
11599  * self.lock = PyThread_allocate_lock()
11600  * if self.lock is NULL:
11601  */
11602  }
11603 
11604  /* "View.MemoryView":363
11605  * raise MemoryError
11606  *
11607  * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
11608  * self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0')
11609  * else:
11610  */
11611  __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0);
11612  if (__pyx_t_1) {
11613 
11614  /* "View.MemoryView":364
11615  *
11616  * if flags & PyBUF_FORMAT:
11617  * self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0') # <<<<<<<<<<<<<<
11618  * else:
11619  * self.dtype_is_object = dtype_is_object
11620  */
11621  __pyx_t_2 = (((__pyx_v_self->view.format[0]) == 'O') != 0);
11622  if (__pyx_t_2) {
11623  } else {
11624  __pyx_t_1 = __pyx_t_2;
11625  goto __pyx_L11_bool_binop_done;
11626  }
11627  __pyx_t_2 = (((__pyx_v_self->view.format[1]) == '\x00') != 0);
11628  __pyx_t_1 = __pyx_t_2;
11629  __pyx_L11_bool_binop_done:;
11630  __pyx_v_self->dtype_is_object = __pyx_t_1;
11631 
11632  /* "View.MemoryView":363
11633  * raise MemoryError
11634  *
11635  * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
11636  * self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0')
11637  * else:
11638  */
11639  goto __pyx_L10;
11640  }
11641 
11642  /* "View.MemoryView":366
11643  * self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0')
11644  * else:
11645  * self.dtype_is_object = dtype_is_object # <<<<<<<<<<<<<<
11646  *
11647  * self.acquisition_count_aligned_p = <__pyx_atomic_int *> align_pointer(
11648  */
11649  /*else*/ {
11650  __pyx_v_self->dtype_is_object = __pyx_v_dtype_is_object;
11651  }
11652  __pyx_L10:;
11653 
11654  /* "View.MemoryView":368
11655  * self.dtype_is_object = dtype_is_object
11656  *
11657  * self.acquisition_count_aligned_p = <__pyx_atomic_int *> align_pointer( # <<<<<<<<<<<<<<
11658  * <void *> &self.acquisition_count[0], sizeof(__pyx_atomic_int))
11659  * self.typeinfo = NULL
11660  */
11661  __pyx_v_self->acquisition_count_aligned_p = ((__pyx_atomic_int *)__pyx_align_pointer(((void *)(&(__pyx_v_self->acquisition_count[0]))), (sizeof(__pyx_atomic_int))));
11662 
11663  /* "View.MemoryView":370
11664  * self.acquisition_count_aligned_p = <__pyx_atomic_int *> align_pointer(
11665  * <void *> &self.acquisition_count[0], sizeof(__pyx_atomic_int))
11666  * self.typeinfo = NULL # <<<<<<<<<<<<<<
11667  *
11668  * def __dealloc__(memoryview self):
11669  */
11670  __pyx_v_self->typeinfo = NULL;
11671 
11672  /* "View.MemoryView":345
11673  * cdef __Pyx_TypeInfo *typeinfo
11674  *
11675  * def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False): # <<<<<<<<<<<<<<
11676  * self.obj = obj
11677  * self.flags = flags
11678  */
11679 
11680  /* function exit code */
11681  __pyx_r = 0;
11682  goto __pyx_L0;
11683  __pyx_L1_error:;
11684  __Pyx_AddTraceback("View.MemoryView.memoryview.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11685  __pyx_r = -1;
11686  __pyx_L0:;
11687  __Pyx_RefNannyFinishContext();
11688  return __pyx_r;
11689 }
11690 
11691 /* "View.MemoryView":372
11692  * self.typeinfo = NULL
11693  *
11694  * def __dealloc__(memoryview self): # <<<<<<<<<<<<<<
11695  * if self.obj is not None:
11696  * __Pyx_ReleaseBuffer(&self.view)
11697  */
11698 
11699 /* Python wrapper */
11700 static void __pyx_memoryview___dealloc__(PyObject *__pyx_v_self); /*proto*/
11701 static void __pyx_memoryview___dealloc__(PyObject *__pyx_v_self) {
11702  __Pyx_RefNannyDeclarations
11703  __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
11704  __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(((struct __pyx_memoryview_obj *)__pyx_v_self));
11705 
11706  /* function exit code */
11707  __Pyx_RefNannyFinishContext();
11708 }
11709 
11710 static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(struct __pyx_memoryview_obj *__pyx_v_self) {
11711  int __pyx_v_i;
11712  __Pyx_RefNannyDeclarations
11713  int __pyx_t_1;
11714  int __pyx_t_2;
11715  int __pyx_t_3;
11716  int __pyx_t_4;
11717  int __pyx_t_5;
11718  PyThread_type_lock __pyx_t_6;
11719  PyThread_type_lock __pyx_t_7;
11720  __Pyx_RefNannySetupContext("__dealloc__", 0);
11721 
11722  /* "View.MemoryView":373
11723  *
11724  * def __dealloc__(memoryview self):
11725  * if self.obj is not None: # <<<<<<<<<<<<<<
11726  * __Pyx_ReleaseBuffer(&self.view)
11727  *
11728  */
11729  __pyx_t_1 = (__pyx_v_self->obj != Py_None);
11730  __pyx_t_2 = (__pyx_t_1 != 0);
11731  if (__pyx_t_2) {
11732 
11733  /* "View.MemoryView":374
11734  * def __dealloc__(memoryview self):
11735  * if self.obj is not None:
11736  * __Pyx_ReleaseBuffer(&self.view) # <<<<<<<<<<<<<<
11737  *
11738  * cdef int i
11739  */
11740  __Pyx_ReleaseBuffer((&__pyx_v_self->view));
11741 
11742  /* "View.MemoryView":373
11743  *
11744  * def __dealloc__(memoryview self):
11745  * if self.obj is not None: # <<<<<<<<<<<<<<
11746  * __Pyx_ReleaseBuffer(&self.view)
11747  *
11748  */
11749  }
11750 
11751  /* "View.MemoryView":378
11752  * cdef int i
11753  * global __pyx_memoryview_thread_locks_used
11754  * if self.lock != NULL: # <<<<<<<<<<<<<<
11755  * for i in range(__pyx_memoryview_thread_locks_used):
11756  * if __pyx_memoryview_thread_locks[i] is self.lock:
11757  */
11758  __pyx_t_2 = ((__pyx_v_self->lock != NULL) != 0);
11759  if (__pyx_t_2) {
11760 
11761  /* "View.MemoryView":379
11762  * global __pyx_memoryview_thread_locks_used
11763  * if self.lock != NULL:
11764  * for i in range(__pyx_memoryview_thread_locks_used): # <<<<<<<<<<<<<<
11765  * if __pyx_memoryview_thread_locks[i] is self.lock:
11766  * __pyx_memoryview_thread_locks_used -= 1
11767  */
11768  __pyx_t_3 = __pyx_memoryview_thread_locks_used;
11769  __pyx_t_4 = __pyx_t_3;
11770  for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) {
11771  __pyx_v_i = __pyx_t_5;
11772 
11773  /* "View.MemoryView":380
11774  * if self.lock != NULL:
11775  * for i in range(__pyx_memoryview_thread_locks_used):
11776  * if __pyx_memoryview_thread_locks[i] is self.lock: # <<<<<<<<<<<<<<
11777  * __pyx_memoryview_thread_locks_used -= 1
11778  * if i != __pyx_memoryview_thread_locks_used:
11779  */
11780  __pyx_t_2 = (((__pyx_memoryview_thread_locks[__pyx_v_i]) == __pyx_v_self->lock) != 0);
11781  if (__pyx_t_2) {
11782 
11783  /* "View.MemoryView":381
11784  * for i in range(__pyx_memoryview_thread_locks_used):
11785  * if __pyx_memoryview_thread_locks[i] is self.lock:
11786  * __pyx_memoryview_thread_locks_used -= 1 # <<<<<<<<<<<<<<
11787  * if i != __pyx_memoryview_thread_locks_used:
11788  * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
11789  */
11790  __pyx_memoryview_thread_locks_used = (__pyx_memoryview_thread_locks_used - 1);
11791 
11792  /* "View.MemoryView":382
11793  * if __pyx_memoryview_thread_locks[i] is self.lock:
11794  * __pyx_memoryview_thread_locks_used -= 1
11795  * if i != __pyx_memoryview_thread_locks_used: # <<<<<<<<<<<<<<
11796  * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
11797  * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i])
11798  */
11799  __pyx_t_2 = ((__pyx_v_i != __pyx_memoryview_thread_locks_used) != 0);
11800  if (__pyx_t_2) {
11801 
11802  /* "View.MemoryView":384
11803  * if i != __pyx_memoryview_thread_locks_used:
11804  * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
11805  * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i]) # <<<<<<<<<<<<<<
11806  * break
11807  * else:
11808  */
11809  __pyx_t_6 = (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]);
11810  __pyx_t_7 = (__pyx_memoryview_thread_locks[__pyx_v_i]);
11811 
11812  /* "View.MemoryView":383
11813  * __pyx_memoryview_thread_locks_used -= 1
11814  * if i != __pyx_memoryview_thread_locks_used:
11815  * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = ( # <<<<<<<<<<<<<<
11816  * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i])
11817  * break
11818  */
11819  (__pyx_memoryview_thread_locks[__pyx_v_i]) = __pyx_t_6;
11820  (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]) = __pyx_t_7;
11821 
11822  /* "View.MemoryView":382
11823  * if __pyx_memoryview_thread_locks[i] is self.lock:
11824  * __pyx_memoryview_thread_locks_used -= 1
11825  * if i != __pyx_memoryview_thread_locks_used: # <<<<<<<<<<<<<<
11826  * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
11827  * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i])
11828  */
11829  }
11830 
11831  /* "View.MemoryView":385
11832  * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
11833  * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i])
11834  * break # <<<<<<<<<<<<<<
11835  * else:
11836  * PyThread_free_lock(self.lock)
11837  */
11838  goto __pyx_L6_break;
11839 
11840  /* "View.MemoryView":380
11841  * if self.lock != NULL:
11842  * for i in range(__pyx_memoryview_thread_locks_used):
11843  * if __pyx_memoryview_thread_locks[i] is self.lock: # <<<<<<<<<<<<<<
11844  * __pyx_memoryview_thread_locks_used -= 1
11845  * if i != __pyx_memoryview_thread_locks_used:
11846  */
11847  }
11848  }
11849  /*else*/ {
11850 
11851  /* "View.MemoryView":387
11852  * break
11853  * else:
11854  * PyThread_free_lock(self.lock) # <<<<<<<<<<<<<<
11855  *
11856  * cdef char *get_item_pointer(memoryview self, object index) except NULL:
11857  */
11858  PyThread_free_lock(__pyx_v_self->lock);
11859  }
11860  __pyx_L6_break:;
11861 
11862  /* "View.MemoryView":378
11863  * cdef int i
11864  * global __pyx_memoryview_thread_locks_used
11865  * if self.lock != NULL: # <<<<<<<<<<<<<<
11866  * for i in range(__pyx_memoryview_thread_locks_used):
11867  * if __pyx_memoryview_thread_locks[i] is self.lock:
11868  */
11869  }
11870 
11871  /* "View.MemoryView":372
11872  * self.typeinfo = NULL
11873  *
11874  * def __dealloc__(memoryview self): # <<<<<<<<<<<<<<
11875  * if self.obj is not None:
11876  * __Pyx_ReleaseBuffer(&self.view)
11877  */
11878 
11879  /* function exit code */
11880  __Pyx_RefNannyFinishContext();
11881 }
11882 
11883 /* "View.MemoryView":389
11884  * PyThread_free_lock(self.lock)
11885  *
11886  * cdef char *get_item_pointer(memoryview self, object index) except NULL: # <<<<<<<<<<<<<<
11887  * cdef Py_ssize_t dim
11888  * cdef char *itemp = <char *> self.view.buf
11889  */
11890 
11891 static char *__pyx_memoryview_get_item_pointer(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index) {
11892  Py_ssize_t __pyx_v_dim;
11893  char *__pyx_v_itemp;
11894  PyObject *__pyx_v_idx = NULL;
11895  char *__pyx_r;
11896  __Pyx_RefNannyDeclarations
11897  Py_ssize_t __pyx_t_1;
11898  PyObject *__pyx_t_2 = NULL;
11899  Py_ssize_t __pyx_t_3;
11900  PyObject *(*__pyx_t_4)(PyObject *);
11901  PyObject *__pyx_t_5 = NULL;
11902  Py_ssize_t __pyx_t_6;
11903  char *__pyx_t_7;
11904  __Pyx_RefNannySetupContext("get_item_pointer", 0);
11905 
11906  /* "View.MemoryView":391
11907  * cdef char *get_item_pointer(memoryview self, object index) except NULL:
11908  * cdef Py_ssize_t dim
11909  * cdef char *itemp = <char *> self.view.buf # <<<<<<<<<<<<<<
11910  *
11911  * for dim, idx in enumerate(index):
11912  */
11913  __pyx_v_itemp = ((char *)__pyx_v_self->view.buf);
11914 
11915  /* "View.MemoryView":393
11916  * cdef char *itemp = <char *> self.view.buf
11917  *
11918  * for dim, idx in enumerate(index): # <<<<<<<<<<<<<<
11919  * itemp = pybuffer_index(&self.view, itemp, idx, dim)
11920  *
11921  */
11922  __pyx_t_1 = 0;
11923  if (likely(PyList_CheckExact(__pyx_v_index)) || PyTuple_CheckExact(__pyx_v_index)) {
11924  __pyx_t_2 = __pyx_v_index; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0;
11925  __pyx_t_4 = NULL;
11926  } else {
11927  __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 393, __pyx_L1_error)
11928  __Pyx_GOTREF(__pyx_t_2);
11929  __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 393, __pyx_L1_error)
11930  }
11931  for (;;) {
11932  if (likely(!__pyx_t_4)) {
11933  if (likely(PyList_CheckExact(__pyx_t_2))) {
11934  if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break;
11935  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
11936  __pyx_t_5 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(2, 393, __pyx_L1_error)
11937  #else
11938  __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 393, __pyx_L1_error)
11939  __Pyx_GOTREF(__pyx_t_5);
11940  #endif
11941  } else {
11942  if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
11943  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
11944  __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(2, 393, __pyx_L1_error)
11945  #else
11946  __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 393, __pyx_L1_error)
11947  __Pyx_GOTREF(__pyx_t_5);
11948  #endif
11949  }
11950  } else {
11951  __pyx_t_5 = __pyx_t_4(__pyx_t_2);
11952  if (unlikely(!__pyx_t_5)) {
11953  PyObject* exc_type = PyErr_Occurred();
11954  if (exc_type) {
11955  if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
11956  else __PYX_ERR(2, 393, __pyx_L1_error)
11957  }
11958  break;
11959  }
11960  __Pyx_GOTREF(__pyx_t_5);
11961  }
11962  __Pyx_XDECREF_SET(__pyx_v_idx, __pyx_t_5);
11963  __pyx_t_5 = 0;
11964  __pyx_v_dim = __pyx_t_1;
11965  __pyx_t_1 = (__pyx_t_1 + 1);
11966 
11967  /* "View.MemoryView":394
11968  *
11969  * for dim, idx in enumerate(index):
11970  * itemp = pybuffer_index(&self.view, itemp, idx, dim) # <<<<<<<<<<<<<<
11971  *
11972  * return itemp
11973  */
11974  __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_v_idx); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(2, 394, __pyx_L1_error)
11975  __pyx_t_7 = __pyx_pybuffer_index((&__pyx_v_self->view), __pyx_v_itemp, __pyx_t_6, __pyx_v_dim); if (unlikely(__pyx_t_7 == ((char *)NULL))) __PYX_ERR(2, 394, __pyx_L1_error)
11976  __pyx_v_itemp = __pyx_t_7;
11977 
11978  /* "View.MemoryView":393
11979  * cdef char *itemp = <char *> self.view.buf
11980  *
11981  * for dim, idx in enumerate(index): # <<<<<<<<<<<<<<
11982  * itemp = pybuffer_index(&self.view, itemp, idx, dim)
11983  *
11984  */
11985  }
11986  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11987 
11988  /* "View.MemoryView":396
11989  * itemp = pybuffer_index(&self.view, itemp, idx, dim)
11990  *
11991  * return itemp # <<<<<<<<<<<<<<
11992  *
11993  *
11994  */
11995  __pyx_r = __pyx_v_itemp;
11996  goto __pyx_L0;
11997 
11998  /* "View.MemoryView":389
11999  * PyThread_free_lock(self.lock)
12000  *
12001  * cdef char *get_item_pointer(memoryview self, object index) except NULL: # <<<<<<<<<<<<<<
12002  * cdef Py_ssize_t dim
12003  * cdef char *itemp = <char *> self.view.buf
12004  */
12005 
12006  /* function exit code */
12007  __pyx_L1_error:;
12008  __Pyx_XDECREF(__pyx_t_2);
12009  __Pyx_XDECREF(__pyx_t_5);
12010  __Pyx_AddTraceback("View.MemoryView.memoryview.get_item_pointer", __pyx_clineno, __pyx_lineno, __pyx_filename);
12011  __pyx_r = NULL;
12012  __pyx_L0:;
12013  __Pyx_XDECREF(__pyx_v_idx);
12014  __Pyx_RefNannyFinishContext();
12015  return __pyx_r;
12016 }
12017 
12018 /* "View.MemoryView":399
12019  *
12020  *
12021  * def __getitem__(memoryview self, object index): # <<<<<<<<<<<<<<
12022  * if index is Ellipsis:
12023  * return self
12024  */
12025 
12026 /* Python wrapper */
12027 static PyObject *__pyx_memoryview___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index); /*proto*/
12028 static PyObject *__pyx_memoryview___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index) {
12029  PyObject *__pyx_r = 0;
12030  __Pyx_RefNannyDeclarations
12031  __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0);
12032  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4__getitem__(((struct __pyx_memoryview_obj *)__pyx_v_self), ((PyObject *)__pyx_v_index));
12033 
12034  /* function exit code */
12035  __Pyx_RefNannyFinishContext();
12036  return __pyx_r;
12037 }
12038 
12039 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4__getitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index) {
12040  PyObject *__pyx_v_have_slices = NULL;
12041  PyObject *__pyx_v_indices = NULL;
12042  char *__pyx_v_itemp;
12043  PyObject *__pyx_r = NULL;
12044  __Pyx_RefNannyDeclarations
12045  int __pyx_t_1;
12046  int __pyx_t_2;
12047  PyObject *__pyx_t_3 = NULL;
12048  PyObject *__pyx_t_4 = NULL;
12049  PyObject *__pyx_t_5 = NULL;
12050  char *__pyx_t_6;
12051  __Pyx_RefNannySetupContext("__getitem__", 0);
12052 
12053  /* "View.MemoryView":400
12054  *
12055  * def __getitem__(memoryview self, object index):
12056  * if index is Ellipsis: # <<<<<<<<<<<<<<
12057  * return self
12058  *
12059  */
12060  __pyx_t_1 = (__pyx_v_index == __pyx_builtin_Ellipsis);
12061  __pyx_t_2 = (__pyx_t_1 != 0);
12062  if (__pyx_t_2) {
12063 
12064  /* "View.MemoryView":401
12065  * def __getitem__(memoryview self, object index):
12066  * if index is Ellipsis:
12067  * return self # <<<<<<<<<<<<<<
12068  *
12069  * have_slices, indices = _unellipsify(index, self.view.ndim)
12070  */
12071  __Pyx_XDECREF(__pyx_r);
12072  __Pyx_INCREF(((PyObject *)__pyx_v_self));
12073  __pyx_r = ((PyObject *)__pyx_v_self);
12074  goto __pyx_L0;
12075 
12076  /* "View.MemoryView":400
12077  *
12078  * def __getitem__(memoryview self, object index):
12079  * if index is Ellipsis: # <<<<<<<<<<<<<<
12080  * return self
12081  *
12082  */
12083  }
12084 
12085  /* "View.MemoryView":403
12086  * return self
12087  *
12088  * have_slices, indices = _unellipsify(index, self.view.ndim) # <<<<<<<<<<<<<<
12089  *
12090  * cdef char *itemp
12091  */
12092  __pyx_t_3 = _unellipsify(__pyx_v_index, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 403, __pyx_L1_error)
12093  __Pyx_GOTREF(__pyx_t_3);
12094  if (likely(__pyx_t_3 != Py_None)) {
12095  PyObject* sequence = __pyx_t_3;
12096  Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
12097  if (unlikely(size != 2)) {
12098  if (size > 2) __Pyx_RaiseTooManyValuesError(2);
12099  else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
12100  __PYX_ERR(2, 403, __pyx_L1_error)
12101  }
12102  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
12103  __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0);
12104  __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1);
12105  __Pyx_INCREF(__pyx_t_4);
12106  __Pyx_INCREF(__pyx_t_5);
12107  #else
12108  __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 403, __pyx_L1_error)
12109  __Pyx_GOTREF(__pyx_t_4);
12110  __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 403, __pyx_L1_error)
12111  __Pyx_GOTREF(__pyx_t_5);
12112  #endif
12113  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
12114  } else {
12115  __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(2, 403, __pyx_L1_error)
12116  }
12117  __pyx_v_have_slices = __pyx_t_4;
12118  __pyx_t_4 = 0;
12119  __pyx_v_indices = __pyx_t_5;
12120  __pyx_t_5 = 0;
12121 
12122  /* "View.MemoryView":406
12123  *
12124  * cdef char *itemp
12125  * if have_slices: # <<<<<<<<<<<<<<
12126  * return memview_slice(self, indices)
12127  * else:
12128  */
12129  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_have_slices); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(2, 406, __pyx_L1_error)
12130  if (__pyx_t_2) {
12131 
12132  /* "View.MemoryView":407
12133  * cdef char *itemp
12134  * if have_slices:
12135  * return memview_slice(self, indices) # <<<<<<<<<<<<<<
12136  * else:
12137  * itemp = self.get_item_pointer(indices)
12138  */
12139  __Pyx_XDECREF(__pyx_r);
12140  __pyx_t_3 = ((PyObject *)__pyx_memview_slice(__pyx_v_self, __pyx_v_indices)); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 407, __pyx_L1_error)
12141  __Pyx_GOTREF(__pyx_t_3);
12142  __pyx_r = __pyx_t_3;
12143  __pyx_t_3 = 0;
12144  goto __pyx_L0;
12145 
12146  /* "View.MemoryView":406
12147  *
12148  * cdef char *itemp
12149  * if have_slices: # <<<<<<<<<<<<<<
12150  * return memview_slice(self, indices)
12151  * else:
12152  */
12153  }
12154 
12155  /* "View.MemoryView":409
12156  * return memview_slice(self, indices)
12157  * else:
12158  * itemp = self.get_item_pointer(indices) # <<<<<<<<<<<<<<
12159  * return self.convert_item_to_object(itemp)
12160  *
12161  */
12162  /*else*/ {
12163  __pyx_t_6 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->get_item_pointer(__pyx_v_self, __pyx_v_indices); if (unlikely(__pyx_t_6 == ((char *)NULL))) __PYX_ERR(2, 409, __pyx_L1_error)
12164  __pyx_v_itemp = __pyx_t_6;
12165 
12166  /* "View.MemoryView":410
12167  * else:
12168  * itemp = self.get_item_pointer(indices)
12169  * return self.convert_item_to_object(itemp) # <<<<<<<<<<<<<<
12170  *
12171  * def __setitem__(memoryview self, object index, object value):
12172  */
12173  __Pyx_XDECREF(__pyx_r);
12174  __pyx_t_3 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->convert_item_to_object(__pyx_v_self, __pyx_v_itemp); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 410, __pyx_L1_error)
12175  __Pyx_GOTREF(__pyx_t_3);
12176  __pyx_r = __pyx_t_3;
12177  __pyx_t_3 = 0;
12178  goto __pyx_L0;
12179  }
12180 
12181  /* "View.MemoryView":399
12182  *
12183  *
12184  * def __getitem__(memoryview self, object index): # <<<<<<<<<<<<<<
12185  * if index is Ellipsis:
12186  * return self
12187  */
12188 
12189  /* function exit code */
12190  __pyx_L1_error:;
12191  __Pyx_XDECREF(__pyx_t_3);
12192  __Pyx_XDECREF(__pyx_t_4);
12193  __Pyx_XDECREF(__pyx_t_5);
12194  __Pyx_AddTraceback("View.MemoryView.memoryview.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
12195  __pyx_r = NULL;
12196  __pyx_L0:;
12197  __Pyx_XDECREF(__pyx_v_have_slices);
12198  __Pyx_XDECREF(__pyx_v_indices);
12199  __Pyx_XGIVEREF(__pyx_r);
12200  __Pyx_RefNannyFinishContext();
12201  return __pyx_r;
12202 }
12203 
12204 /* "View.MemoryView":412
12205  * return self.convert_item_to_object(itemp)
12206  *
12207  * def __setitem__(memoryview self, object index, object value): # <<<<<<<<<<<<<<
12208  * if self.view.readonly:
12209  * raise TypeError("Cannot assign to read-only memoryview")
12210  */
12211 
12212 /* Python wrapper */
12213 static int __pyx_memoryview___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value); /*proto*/
12214 static int __pyx_memoryview___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) {
12215  int __pyx_r;
12216  __Pyx_RefNannyDeclarations
12217  __Pyx_RefNannySetupContext("__setitem__ (wrapper)", 0);
12218  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setitem__(((struct __pyx_memoryview_obj *)__pyx_v_self), ((PyObject *)__pyx_v_index), ((PyObject *)__pyx_v_value));
12219 
12220  /* function exit code */
12221  __Pyx_RefNannyFinishContext();
12222  return __pyx_r;
12223 }
12224 
12225 static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) {
12226  PyObject *__pyx_v_have_slices = NULL;
12227  PyObject *__pyx_v_obj = NULL;
12228  int __pyx_r;
12229  __Pyx_RefNannyDeclarations
12230  int __pyx_t_1;
12231  PyObject *__pyx_t_2 = NULL;
12232  PyObject *__pyx_t_3 = NULL;
12233  PyObject *__pyx_t_4 = NULL;
12234  __Pyx_RefNannySetupContext("__setitem__", 0);
12235  __Pyx_INCREF(__pyx_v_index);
12236 
12237  /* "View.MemoryView":413
12238  *
12239  * def __setitem__(memoryview self, object index, object value):
12240  * if self.view.readonly: # <<<<<<<<<<<<<<
12241  * raise TypeError("Cannot assign to read-only memoryview")
12242  *
12243  */
12244  __pyx_t_1 = (__pyx_v_self->view.readonly != 0);
12245  if (unlikely(__pyx_t_1)) {
12246 
12247  /* "View.MemoryView":414
12248  * def __setitem__(memoryview self, object index, object value):
12249  * if self.view.readonly:
12250  * raise TypeError("Cannot assign to read-only memoryview") # <<<<<<<<<<<<<<
12251  *
12252  * have_slices, index = _unellipsify(index, self.view.ndim)
12253  */
12254  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__15, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 414, __pyx_L1_error)
12255  __Pyx_GOTREF(__pyx_t_2);
12256  __Pyx_Raise(__pyx_t_2, 0, 0, 0);
12257  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12258  __PYX_ERR(2, 414, __pyx_L1_error)
12259 
12260  /* "View.MemoryView":413
12261  *
12262  * def __setitem__(memoryview self, object index, object value):
12263  * if self.view.readonly: # <<<<<<<<<<<<<<
12264  * raise TypeError("Cannot assign to read-only memoryview")
12265  *
12266  */
12267  }
12268 
12269  /* "View.MemoryView":416
12270  * raise TypeError("Cannot assign to read-only memoryview")
12271  *
12272  * have_slices, index = _unellipsify(index, self.view.ndim) # <<<<<<<<<<<<<<
12273  *
12274  * if have_slices:
12275  */
12276  __pyx_t_2 = _unellipsify(__pyx_v_index, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 416, __pyx_L1_error)
12277  __Pyx_GOTREF(__pyx_t_2);
12278  if (likely(__pyx_t_2 != Py_None)) {
12279  PyObject* sequence = __pyx_t_2;
12280  Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
12281  if (unlikely(size != 2)) {
12282  if (size > 2) __Pyx_RaiseTooManyValuesError(2);
12283  else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
12284  __PYX_ERR(2, 416, __pyx_L1_error)
12285  }
12286  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
12287  __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0);
12288  __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1);
12289  __Pyx_INCREF(__pyx_t_3);
12290  __Pyx_INCREF(__pyx_t_4);
12291  #else
12292  __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 416, __pyx_L1_error)
12293  __Pyx_GOTREF(__pyx_t_3);
12294  __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 416, __pyx_L1_error)
12295  __Pyx_GOTREF(__pyx_t_4);
12296  #endif
12297  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12298  } else {
12299  __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(2, 416, __pyx_L1_error)
12300  }
12301  __pyx_v_have_slices = __pyx_t_3;
12302  __pyx_t_3 = 0;
12303  __Pyx_DECREF_SET(__pyx_v_index, __pyx_t_4);
12304  __pyx_t_4 = 0;
12305 
12306  /* "View.MemoryView":418
12307  * have_slices, index = _unellipsify(index, self.view.ndim)
12308  *
12309  * if have_slices: # <<<<<<<<<<<<<<
12310  * obj = self.is_slice(value)
12311  * if obj:
12312  */
12313  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_have_slices); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(2, 418, __pyx_L1_error)
12314  if (__pyx_t_1) {
12315 
12316  /* "View.MemoryView":419
12317  *
12318  * if have_slices:
12319  * obj = self.is_slice(value) # <<<<<<<<<<<<<<
12320  * if obj:
12321  * self.setitem_slice_assignment(self[index], obj)
12322  */
12323  __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->is_slice(__pyx_v_self, __pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 419, __pyx_L1_error)
12324  __Pyx_GOTREF(__pyx_t_2);
12325  __pyx_v_obj = __pyx_t_2;
12326  __pyx_t_2 = 0;
12327 
12328  /* "View.MemoryView":420
12329  * if have_slices:
12330  * obj = self.is_slice(value)
12331  * if obj: # <<<<<<<<<<<<<<
12332  * self.setitem_slice_assignment(self[index], obj)
12333  * else:
12334  */
12335  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_obj); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(2, 420, __pyx_L1_error)
12336  if (__pyx_t_1) {
12337 
12338  /* "View.MemoryView":421
12339  * obj = self.is_slice(value)
12340  * if obj:
12341  * self.setitem_slice_assignment(self[index], obj) # <<<<<<<<<<<<<<
12342  * else:
12343  * self.setitem_slice_assign_scalar(self[index], value)
12344  */
12345  __pyx_t_2 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_v_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 421, __pyx_L1_error)
12346  __Pyx_GOTREF(__pyx_t_2);
12347  __pyx_t_4 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_slice_assignment(__pyx_v_self, __pyx_t_2, __pyx_v_obj); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 421, __pyx_L1_error)
12348  __Pyx_GOTREF(__pyx_t_4);
12349  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12350  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
12351 
12352  /* "View.MemoryView":420
12353  * if have_slices:
12354  * obj = self.is_slice(value)
12355  * if obj: # <<<<<<<<<<<<<<
12356  * self.setitem_slice_assignment(self[index], obj)
12357  * else:
12358  */
12359  goto __pyx_L5;
12360  }
12361 
12362  /* "View.MemoryView":423
12363  * self.setitem_slice_assignment(self[index], obj)
12364  * else:
12365  * self.setitem_slice_assign_scalar(self[index], value) # <<<<<<<<<<<<<<
12366  * else:
12367  * self.setitem_indexed(index, value)
12368  */
12369  /*else*/ {
12370  __pyx_t_4 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_v_index); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 423, __pyx_L1_error)
12371  __Pyx_GOTREF(__pyx_t_4);
12372  if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_memoryview_type))))) __PYX_ERR(2, 423, __pyx_L1_error)
12373  __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_slice_assign_scalar(__pyx_v_self, ((struct __pyx_memoryview_obj *)__pyx_t_4), __pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 423, __pyx_L1_error)
12374  __Pyx_GOTREF(__pyx_t_2);
12375  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
12376  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12377  }
12378  __pyx_L5:;
12379 
12380  /* "View.MemoryView":418
12381  * have_slices, index = _unellipsify(index, self.view.ndim)
12382  *
12383  * if have_slices: # <<<<<<<<<<<<<<
12384  * obj = self.is_slice(value)
12385  * if obj:
12386  */
12387  goto __pyx_L4;
12388  }
12389 
12390  /* "View.MemoryView":425
12391  * self.setitem_slice_assign_scalar(self[index], value)
12392  * else:
12393  * self.setitem_indexed(index, value) # <<<<<<<<<<<<<<
12394  *
12395  * cdef is_slice(self, obj):
12396  */
12397  /*else*/ {
12398  __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_indexed(__pyx_v_self, __pyx_v_index, __pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 425, __pyx_L1_error)
12399  __Pyx_GOTREF(__pyx_t_2);
12400  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12401  }
12402  __pyx_L4:;
12403 
12404  /* "View.MemoryView":412
12405  * return self.convert_item_to_object(itemp)
12406  *
12407  * def __setitem__(memoryview self, object index, object value): # <<<<<<<<<<<<<<
12408  * if self.view.readonly:
12409  * raise TypeError("Cannot assign to read-only memoryview")
12410  */
12411 
12412  /* function exit code */
12413  __pyx_r = 0;
12414  goto __pyx_L0;
12415  __pyx_L1_error:;
12416  __Pyx_XDECREF(__pyx_t_2);
12417  __Pyx_XDECREF(__pyx_t_3);
12418  __Pyx_XDECREF(__pyx_t_4);
12419  __Pyx_AddTraceback("View.MemoryView.memoryview.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
12420  __pyx_r = -1;
12421  __pyx_L0:;
12422  __Pyx_XDECREF(__pyx_v_have_slices);
12423  __Pyx_XDECREF(__pyx_v_obj);
12424  __Pyx_XDECREF(__pyx_v_index);
12425  __Pyx_RefNannyFinishContext();
12426  return __pyx_r;
12427 }
12428 
12429 /* "View.MemoryView":427
12430  * self.setitem_indexed(index, value)
12431  *
12432  * cdef is_slice(self, obj): # <<<<<<<<<<<<<<
12433  * if not isinstance(obj, memoryview):
12434  * try:
12435  */
12436 
12437 static PyObject *__pyx_memoryview_is_slice(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj) {
12438  PyObject *__pyx_r = NULL;
12439  __Pyx_RefNannyDeclarations
12440  int __pyx_t_1;
12441  int __pyx_t_2;
12442  PyObject *__pyx_t_3 = NULL;
12443  PyObject *__pyx_t_4 = NULL;
12444  PyObject *__pyx_t_5 = NULL;
12445  PyObject *__pyx_t_6 = NULL;
12446  PyObject *__pyx_t_7 = NULL;
12447  PyObject *__pyx_t_8 = NULL;
12448  int __pyx_t_9;
12449  __Pyx_RefNannySetupContext("is_slice", 0);
12450  __Pyx_INCREF(__pyx_v_obj);
12451 
12452  /* "View.MemoryView":428
12453  *
12454  * cdef is_slice(self, obj):
12455  * if not isinstance(obj, memoryview): # <<<<<<<<<<<<<<
12456  * try:
12457  * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
12458  */
12459  __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_obj, __pyx_memoryview_type);
12460  __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
12461  if (__pyx_t_2) {
12462 
12463  /* "View.MemoryView":429
12464  * cdef is_slice(self, obj):
12465  * if not isinstance(obj, memoryview):
12466  * try: # <<<<<<<<<<<<<<
12467  * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
12468  * self.dtype_is_object)
12469  */
12470  {
12471  __Pyx_PyThreadState_declare
12472  __Pyx_PyThreadState_assign
12473  __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5);
12474  __Pyx_XGOTREF(__pyx_t_3);
12475  __Pyx_XGOTREF(__pyx_t_4);
12476  __Pyx_XGOTREF(__pyx_t_5);
12477  /*try:*/ {
12478 
12479  /* "View.MemoryView":430
12480  * if not isinstance(obj, memoryview):
12481  * try:
12482  * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS, # <<<<<<<<<<<<<<
12483  * self.dtype_is_object)
12484  * except TypeError:
12485  */
12486  __pyx_t_6 = __Pyx_PyInt_From_int(((__pyx_v_self->flags & (~PyBUF_WRITABLE)) | PyBUF_ANY_CONTIGUOUS)); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 430, __pyx_L4_error)
12487  __Pyx_GOTREF(__pyx_t_6);
12488 
12489  /* "View.MemoryView":431
12490  * try:
12491  * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
12492  * self.dtype_is_object) # <<<<<<<<<<<<<<
12493  * except TypeError:
12494  * return None
12495  */
12496  __pyx_t_7 = __Pyx_PyBool_FromLong(__pyx_v_self->dtype_is_object); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 431, __pyx_L4_error)
12497  __Pyx_GOTREF(__pyx_t_7);
12498 
12499  /* "View.MemoryView":430
12500  * if not isinstance(obj, memoryview):
12501  * try:
12502  * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS, # <<<<<<<<<<<<<<
12503  * self.dtype_is_object)
12504  * except TypeError:
12505  */
12506  __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 430, __pyx_L4_error)
12507  __Pyx_GOTREF(__pyx_t_8);
12508  __Pyx_INCREF(__pyx_v_obj);
12509  __Pyx_GIVEREF(__pyx_v_obj);
12510  PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_obj);
12511  __Pyx_GIVEREF(__pyx_t_6);
12512  PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_6);
12513  __Pyx_GIVEREF(__pyx_t_7);
12514  PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_t_7);
12515  __pyx_t_6 = 0;
12516  __pyx_t_7 = 0;
12517  __pyx_t_7 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_8, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 430, __pyx_L4_error)
12518  __Pyx_GOTREF(__pyx_t_7);
12519  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
12520  __Pyx_DECREF_SET(__pyx_v_obj, __pyx_t_7);
12521  __pyx_t_7 = 0;
12522 
12523  /* "View.MemoryView":429
12524  * cdef is_slice(self, obj):
12525  * if not isinstance(obj, memoryview):
12526  * try: # <<<<<<<<<<<<<<
12527  * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
12528  * self.dtype_is_object)
12529  */
12530  }
12531  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
12532  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
12533  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
12534  goto __pyx_L9_try_end;
12535  __pyx_L4_error:;
12536  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
12537  __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
12538  __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
12539 
12540  /* "View.MemoryView":432
12541  * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
12542  * self.dtype_is_object)
12543  * except TypeError: # <<<<<<<<<<<<<<
12544  * return None
12545  *
12546  */
12547  __pyx_t_9 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_TypeError);
12548  if (__pyx_t_9) {
12549  __Pyx_AddTraceback("View.MemoryView.memoryview.is_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
12550  if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_8, &__pyx_t_6) < 0) __PYX_ERR(2, 432, __pyx_L6_except_error)
12551  __Pyx_GOTREF(__pyx_t_7);
12552  __Pyx_GOTREF(__pyx_t_8);
12553  __Pyx_GOTREF(__pyx_t_6);
12554 
12555  /* "View.MemoryView":433
12556  * self.dtype_is_object)
12557  * except TypeError:
12558  * return None # <<<<<<<<<<<<<<
12559  *
12560  * return obj
12561  */
12562  __Pyx_XDECREF(__pyx_r);
12563  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
12564  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
12565  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
12566  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
12567  goto __pyx_L7_except_return;
12568  }
12569  goto __pyx_L6_except_error;
12570  __pyx_L6_except_error:;
12571 
12572  /* "View.MemoryView":429
12573  * cdef is_slice(self, obj):
12574  * if not isinstance(obj, memoryview):
12575  * try: # <<<<<<<<<<<<<<
12576  * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
12577  * self.dtype_is_object)
12578  */
12579  __Pyx_XGIVEREF(__pyx_t_3);
12580  __Pyx_XGIVEREF(__pyx_t_4);
12581  __Pyx_XGIVEREF(__pyx_t_5);
12582  __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
12583  goto __pyx_L1_error;
12584  __pyx_L7_except_return:;
12585  __Pyx_XGIVEREF(__pyx_t_3);
12586  __Pyx_XGIVEREF(__pyx_t_4);
12587  __Pyx_XGIVEREF(__pyx_t_5);
12588  __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
12589  goto __pyx_L0;
12590  __pyx_L9_try_end:;
12591  }
12592 
12593  /* "View.MemoryView":428
12594  *
12595  * cdef is_slice(self, obj):
12596  * if not isinstance(obj, memoryview): # <<<<<<<<<<<<<<
12597  * try:
12598  * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
12599  */
12600  }
12601 
12602  /* "View.MemoryView":435
12603  * return None
12604  *
12605  * return obj # <<<<<<<<<<<<<<
12606  *
12607  * cdef setitem_slice_assignment(self, dst, src):
12608  */
12609  __Pyx_XDECREF(__pyx_r);
12610  __Pyx_INCREF(__pyx_v_obj);
12611  __pyx_r = __pyx_v_obj;
12612  goto __pyx_L0;
12613 
12614  /* "View.MemoryView":427
12615  * self.setitem_indexed(index, value)
12616  *
12617  * cdef is_slice(self, obj): # <<<<<<<<<<<<<<
12618  * if not isinstance(obj, memoryview):
12619  * try:
12620  */
12621 
12622  /* function exit code */
12623  __pyx_L1_error:;
12624  __Pyx_XDECREF(__pyx_t_6);
12625  __Pyx_XDECREF(__pyx_t_7);
12626  __Pyx_XDECREF(__pyx_t_8);
12627  __Pyx_AddTraceback("View.MemoryView.memoryview.is_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
12628  __pyx_r = 0;
12629  __pyx_L0:;
12630  __Pyx_XDECREF(__pyx_v_obj);
12631  __Pyx_XGIVEREF(__pyx_r);
12632  __Pyx_RefNannyFinishContext();
12633  return __pyx_r;
12634 }
12635 
12636 /* "View.MemoryView":437
12637  * return obj
12638  *
12639  * cdef setitem_slice_assignment(self, dst, src): # <<<<<<<<<<<<<<
12640  * cdef __Pyx_memviewslice dst_slice
12641  * cdef __Pyx_memviewslice src_slice
12642  */
12643 
12644 static PyObject *__pyx_memoryview_setitem_slice_assignment(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_dst, PyObject *__pyx_v_src) {
12645  __Pyx_memviewslice __pyx_v_dst_slice;
12646  __Pyx_memviewslice __pyx_v_src_slice;
12647  PyObject *__pyx_r = NULL;
12648  __Pyx_RefNannyDeclarations
12649  PyObject *__pyx_t_1 = NULL;
12650  int __pyx_t_2;
12651  int __pyx_t_3;
12652  int __pyx_t_4;
12653  __Pyx_RefNannySetupContext("setitem_slice_assignment", 0);
12654 
12655  /* "View.MemoryView":441
12656  * cdef __Pyx_memviewslice src_slice
12657  *
12658  * memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0], # <<<<<<<<<<<<<<
12659  * get_slice_from_memview(dst, &dst_slice)[0],
12660  * src.ndim, dst.ndim, self.dtype_is_object)
12661  */
12662  if (!(likely(((__pyx_v_src) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_src, __pyx_memoryview_type))))) __PYX_ERR(2, 441, __pyx_L1_error)
12663 
12664  /* "View.MemoryView":442
12665  *
12666  * memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0],
12667  * get_slice_from_memview(dst, &dst_slice)[0], # <<<<<<<<<<<<<<
12668  * src.ndim, dst.ndim, self.dtype_is_object)
12669  *
12670  */
12671  if (!(likely(((__pyx_v_dst) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_dst, __pyx_memoryview_type))))) __PYX_ERR(2, 442, __pyx_L1_error)
12672 
12673  /* "View.MemoryView":443
12674  * memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0],
12675  * get_slice_from_memview(dst, &dst_slice)[0],
12676  * src.ndim, dst.ndim, self.dtype_is_object) # <<<<<<<<<<<<<<
12677  *
12678  * cdef setitem_slice_assign_scalar(self, memoryview dst, value):
12679  */
12680  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_src, __pyx_n_s_ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 443, __pyx_L1_error)
12681  __Pyx_GOTREF(__pyx_t_1);
12682  __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 443, __pyx_L1_error)
12683  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12684  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_dst, __pyx_n_s_ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 443, __pyx_L1_error)
12685  __Pyx_GOTREF(__pyx_t_1);
12686  __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 443, __pyx_L1_error)
12687  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12688 
12689  /* "View.MemoryView":441
12690  * cdef __Pyx_memviewslice src_slice
12691  *
12692  * memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0], # <<<<<<<<<<<<<<
12693  * get_slice_from_memview(dst, &dst_slice)[0],
12694  * src.ndim, dst.ndim, self.dtype_is_object)
12695  */
12696  __pyx_t_4 = __pyx_memoryview_copy_contents((__pyx_memoryview_get_slice_from_memoryview(((struct __pyx_memoryview_obj *)__pyx_v_src), (&__pyx_v_src_slice))[0]), (__pyx_memoryview_get_slice_from_memoryview(((struct __pyx_memoryview_obj *)__pyx_v_dst), (&__pyx_v_dst_slice))[0]), __pyx_t_2, __pyx_t_3, __pyx_v_self->dtype_is_object); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(2, 441, __pyx_L1_error)
12697 
12698  /* "View.MemoryView":437
12699  * return obj
12700  *
12701  * cdef setitem_slice_assignment(self, dst, src): # <<<<<<<<<<<<<<
12702  * cdef __Pyx_memviewslice dst_slice
12703  * cdef __Pyx_memviewslice src_slice
12704  */
12705 
12706  /* function exit code */
12707  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
12708  goto __pyx_L0;
12709  __pyx_L1_error:;
12710  __Pyx_XDECREF(__pyx_t_1);
12711  __Pyx_AddTraceback("View.MemoryView.memoryview.setitem_slice_assignment", __pyx_clineno, __pyx_lineno, __pyx_filename);
12712  __pyx_r = 0;
12713  __pyx_L0:;
12714  __Pyx_XGIVEREF(__pyx_r);
12715  __Pyx_RefNannyFinishContext();
12716  return __pyx_r;
12717 }
12718 
12719 /* "View.MemoryView":445
12720  * src.ndim, dst.ndim, self.dtype_is_object)
12721  *
12722  * cdef setitem_slice_assign_scalar(self, memoryview dst, value): # <<<<<<<<<<<<<<
12723  * cdef int array[128]
12724  * cdef void *tmp = NULL
12725  */
12726 
12727 static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memoryview_obj *__pyx_v_self, struct __pyx_memoryview_obj *__pyx_v_dst, PyObject *__pyx_v_value) {
12728  int __pyx_v_array[0x80];
12729  void *__pyx_v_tmp;
12730  void *__pyx_v_item;
12731  __Pyx_memviewslice *__pyx_v_dst_slice;
12732  __Pyx_memviewslice __pyx_v_tmp_slice;
12733  PyObject *__pyx_r = NULL;
12734  __Pyx_RefNannyDeclarations
12735  int __pyx_t_1;
12736  PyObject *__pyx_t_2 = NULL;
12737  int __pyx_t_3;
12738  int __pyx_t_4;
12739  char const *__pyx_t_5;
12740  PyObject *__pyx_t_6 = NULL;
12741  PyObject *__pyx_t_7 = NULL;
12742  PyObject *__pyx_t_8 = NULL;
12743  PyObject *__pyx_t_9 = NULL;
12744  PyObject *__pyx_t_10 = NULL;
12745  PyObject *__pyx_t_11 = NULL;
12746  __Pyx_RefNannySetupContext("setitem_slice_assign_scalar", 0);
12747 
12748  /* "View.MemoryView":447
12749  * cdef setitem_slice_assign_scalar(self, memoryview dst, value):
12750  * cdef int array[128]
12751  * cdef void *tmp = NULL # <<<<<<<<<<<<<<
12752  * cdef void *item
12753  *
12754  */
12755  __pyx_v_tmp = NULL;
12756 
12757  /* "View.MemoryView":452
12758  * cdef __Pyx_memviewslice *dst_slice
12759  * cdef __Pyx_memviewslice tmp_slice
12760  * dst_slice = get_slice_from_memview(dst, &tmp_slice) # <<<<<<<<<<<<<<
12761  *
12762  * if <size_t>self.view.itemsize > sizeof(array):
12763  */
12764  __pyx_v_dst_slice = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_dst, (&__pyx_v_tmp_slice));
12765 
12766  /* "View.MemoryView":454
12767  * dst_slice = get_slice_from_memview(dst, &tmp_slice)
12768  *
12769  * if <size_t>self.view.itemsize > sizeof(array): # <<<<<<<<<<<<<<
12770  * tmp = PyMem_Malloc(self.view.itemsize)
12771  * if tmp == NULL:
12772  */
12773  __pyx_t_1 = ((((size_t)__pyx_v_self->view.itemsize) > (sizeof(__pyx_v_array))) != 0);
12774  if (__pyx_t_1) {
12775 
12776  /* "View.MemoryView":455
12777  *
12778  * if <size_t>self.view.itemsize > sizeof(array):
12779  * tmp = PyMem_Malloc(self.view.itemsize) # <<<<<<<<<<<<<<
12780  * if tmp == NULL:
12781  * raise MemoryError
12782  */
12783  __pyx_v_tmp = PyMem_Malloc(__pyx_v_self->view.itemsize);
12784 
12785  /* "View.MemoryView":456
12786  * if <size_t>self.view.itemsize > sizeof(array):
12787  * tmp = PyMem_Malloc(self.view.itemsize)
12788  * if tmp == NULL: # <<<<<<<<<<<<<<
12789  * raise MemoryError
12790  * item = tmp
12791  */
12792  __pyx_t_1 = ((__pyx_v_tmp == NULL) != 0);
12793  if (unlikely(__pyx_t_1)) {
12794 
12795  /* "View.MemoryView":457
12796  * tmp = PyMem_Malloc(self.view.itemsize)
12797  * if tmp == NULL:
12798  * raise MemoryError # <<<<<<<<<<<<<<
12799  * item = tmp
12800  * else:
12801  */
12802  PyErr_NoMemory(); __PYX_ERR(2, 457, __pyx_L1_error)
12803 
12804  /* "View.MemoryView":456
12805  * if <size_t>self.view.itemsize > sizeof(array):
12806  * tmp = PyMem_Malloc(self.view.itemsize)
12807  * if tmp == NULL: # <<<<<<<<<<<<<<
12808  * raise MemoryError
12809  * item = tmp
12810  */
12811  }
12812 
12813  /* "View.MemoryView":458
12814  * if tmp == NULL:
12815  * raise MemoryError
12816  * item = tmp # <<<<<<<<<<<<<<
12817  * else:
12818  * item = <void *> array
12819  */
12820  __pyx_v_item = __pyx_v_tmp;
12821 
12822  /* "View.MemoryView":454
12823  * dst_slice = get_slice_from_memview(dst, &tmp_slice)
12824  *
12825  * if <size_t>self.view.itemsize > sizeof(array): # <<<<<<<<<<<<<<
12826  * tmp = PyMem_Malloc(self.view.itemsize)
12827  * if tmp == NULL:
12828  */
12829  goto __pyx_L3;
12830  }
12831 
12832  /* "View.MemoryView":460
12833  * item = tmp
12834  * else:
12835  * item = <void *> array # <<<<<<<<<<<<<<
12836  *
12837  * try:
12838  */
12839  /*else*/ {
12840  __pyx_v_item = ((void *)__pyx_v_array);
12841  }
12842  __pyx_L3:;
12843 
12844  /* "View.MemoryView":462
12845  * item = <void *> array
12846  *
12847  * try: # <<<<<<<<<<<<<<
12848  * if self.dtype_is_object:
12849  * (<PyObject **> item)[0] = <PyObject *> value
12850  */
12851  /*try:*/ {
12852 
12853  /* "View.MemoryView":463
12854  *
12855  * try:
12856  * if self.dtype_is_object: # <<<<<<<<<<<<<<
12857  * (<PyObject **> item)[0] = <PyObject *> value
12858  * else:
12859  */
12860  __pyx_t_1 = (__pyx_v_self->dtype_is_object != 0);
12861  if (__pyx_t_1) {
12862 
12863  /* "View.MemoryView":464
12864  * try:
12865  * if self.dtype_is_object:
12866  * (<PyObject **> item)[0] = <PyObject *> value # <<<<<<<<<<<<<<
12867  * else:
12868  * self.assign_item_from_object(<char *> item, value)
12869  */
12870  (((PyObject **)__pyx_v_item)[0]) = ((PyObject *)__pyx_v_value);
12871 
12872  /* "View.MemoryView":463
12873  *
12874  * try:
12875  * if self.dtype_is_object: # <<<<<<<<<<<<<<
12876  * (<PyObject **> item)[0] = <PyObject *> value
12877  * else:
12878  */
12879  goto __pyx_L8;
12880  }
12881 
12882  /* "View.MemoryView":466
12883  * (<PyObject **> item)[0] = <PyObject *> value
12884  * else:
12885  * self.assign_item_from_object(<char *> item, value) # <<<<<<<<<<<<<<
12886  *
12887  *
12888  */
12889  /*else*/ {
12890  __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->assign_item_from_object(__pyx_v_self, ((char *)__pyx_v_item), __pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 466, __pyx_L6_error)
12891  __Pyx_GOTREF(__pyx_t_2);
12892  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12893  }
12894  __pyx_L8:;
12895 
12896  /* "View.MemoryView":470
12897  *
12898  *
12899  * if self.view.suboffsets != NULL: # <<<<<<<<<<<<<<
12900  * assert_direct_dimensions(self.view.suboffsets, self.view.ndim)
12901  * slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize,
12902  */
12903  __pyx_t_1 = ((__pyx_v_self->view.suboffsets != NULL) != 0);
12904  if (__pyx_t_1) {
12905 
12906  /* "View.MemoryView":471
12907  *
12908  * if self.view.suboffsets != NULL:
12909  * assert_direct_dimensions(self.view.suboffsets, self.view.ndim) # <<<<<<<<<<<<<<
12910  * slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize,
12911  * item, self.dtype_is_object)
12912  */
12913  __pyx_t_2 = assert_direct_dimensions(__pyx_v_self->view.suboffsets, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 471, __pyx_L6_error)
12914  __Pyx_GOTREF(__pyx_t_2);
12915  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12916 
12917  /* "View.MemoryView":470
12918  *
12919  *
12920  * if self.view.suboffsets != NULL: # <<<<<<<<<<<<<<
12921  * assert_direct_dimensions(self.view.suboffsets, self.view.ndim)
12922  * slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize,
12923  */
12924  }
12925 
12926  /* "View.MemoryView":472
12927  * if self.view.suboffsets != NULL:
12928  * assert_direct_dimensions(self.view.suboffsets, self.view.ndim)
12929  * slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize, # <<<<<<<<<<<<<<
12930  * item, self.dtype_is_object)
12931  * finally:
12932  */
12933  __pyx_memoryview_slice_assign_scalar(__pyx_v_dst_slice, __pyx_v_dst->view.ndim, __pyx_v_self->view.itemsize, __pyx_v_item, __pyx_v_self->dtype_is_object);
12934  }
12935 
12936  /* "View.MemoryView":475
12937  * item, self.dtype_is_object)
12938  * finally:
12939  * PyMem_Free(tmp) # <<<<<<<<<<<<<<
12940  *
12941  * cdef setitem_indexed(self, index, value):
12942  */
12943  /*finally:*/ {
12944  /*normal exit:*/{
12945  PyMem_Free(__pyx_v_tmp);
12946  goto __pyx_L7;
12947  }
12948  __pyx_L6_error:;
12949  /*exception exit:*/{
12950  __Pyx_PyThreadState_declare
12951  __Pyx_PyThreadState_assign
12952  __pyx_t_6 = 0; __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0;
12953  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
12954  if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11);
12955  if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8) < 0)) __Pyx_ErrFetch(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8);
12956  __Pyx_XGOTREF(__pyx_t_6);
12957  __Pyx_XGOTREF(__pyx_t_7);
12958  __Pyx_XGOTREF(__pyx_t_8);
12959  __Pyx_XGOTREF(__pyx_t_9);
12960  __Pyx_XGOTREF(__pyx_t_10);
12961  __Pyx_XGOTREF(__pyx_t_11);
12962  __pyx_t_3 = __pyx_lineno; __pyx_t_4 = __pyx_clineno; __pyx_t_5 = __pyx_filename;
12963  {
12964  PyMem_Free(__pyx_v_tmp);
12965  }
12966  if (PY_MAJOR_VERSION >= 3) {
12967  __Pyx_XGIVEREF(__pyx_t_9);
12968  __Pyx_XGIVEREF(__pyx_t_10);
12969  __Pyx_XGIVEREF(__pyx_t_11);
12970  __Pyx_ExceptionReset(__pyx_t_9, __pyx_t_10, __pyx_t_11);
12971  }
12972  __Pyx_XGIVEREF(__pyx_t_6);
12973  __Pyx_XGIVEREF(__pyx_t_7);
12974  __Pyx_XGIVEREF(__pyx_t_8);
12975  __Pyx_ErrRestore(__pyx_t_6, __pyx_t_7, __pyx_t_8);
12976  __pyx_t_6 = 0; __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0;
12977  __pyx_lineno = __pyx_t_3; __pyx_clineno = __pyx_t_4; __pyx_filename = __pyx_t_5;
12978  goto __pyx_L1_error;
12979  }
12980  __pyx_L7:;
12981  }
12982 
12983  /* "View.MemoryView":445
12984  * src.ndim, dst.ndim, self.dtype_is_object)
12985  *
12986  * cdef setitem_slice_assign_scalar(self, memoryview dst, value): # <<<<<<<<<<<<<<
12987  * cdef int array[128]
12988  * cdef void *tmp = NULL
12989  */
12990 
12991  /* function exit code */
12992  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
12993  goto __pyx_L0;
12994  __pyx_L1_error:;
12995  __Pyx_XDECREF(__pyx_t_2);
12996  __Pyx_AddTraceback("View.MemoryView.memoryview.setitem_slice_assign_scalar", __pyx_clineno, __pyx_lineno, __pyx_filename);
12997  __pyx_r = 0;
12998  __pyx_L0:;
12999  __Pyx_XGIVEREF(__pyx_r);
13000  __Pyx_RefNannyFinishContext();
13001  return __pyx_r;
13002 }
13003 
13004 /* "View.MemoryView":477
13005  * PyMem_Free(tmp)
13006  *
13007  * cdef setitem_indexed(self, index, value): # <<<<<<<<<<<<<<
13008  * cdef char *itemp = self.get_item_pointer(index)
13009  * self.assign_item_from_object(itemp, value)
13010  */
13011 
13012 static PyObject *__pyx_memoryview_setitem_indexed(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) {
13013  char *__pyx_v_itemp;
13014  PyObject *__pyx_r = NULL;
13015  __Pyx_RefNannyDeclarations
13016  char *__pyx_t_1;
13017  PyObject *__pyx_t_2 = NULL;
13018  __Pyx_RefNannySetupContext("setitem_indexed", 0);
13019 
13020  /* "View.MemoryView":478
13021  *
13022  * cdef setitem_indexed(self, index, value):
13023  * cdef char *itemp = self.get_item_pointer(index) # <<<<<<<<<<<<<<
13024  * self.assign_item_from_object(itemp, value)
13025  *
13026  */
13027  __pyx_t_1 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->get_item_pointer(__pyx_v_self, __pyx_v_index); if (unlikely(__pyx_t_1 == ((char *)NULL))) __PYX_ERR(2, 478, __pyx_L1_error)
13028  __pyx_v_itemp = __pyx_t_1;
13029 
13030  /* "View.MemoryView":479
13031  * cdef setitem_indexed(self, index, value):
13032  * cdef char *itemp = self.get_item_pointer(index)
13033  * self.assign_item_from_object(itemp, value) # <<<<<<<<<<<<<<
13034  *
13035  * cdef convert_item_to_object(self, char *itemp):
13036  */
13037  __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->assign_item_from_object(__pyx_v_self, __pyx_v_itemp, __pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 479, __pyx_L1_error)
13038  __Pyx_GOTREF(__pyx_t_2);
13039  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
13040 
13041  /* "View.MemoryView":477
13042  * PyMem_Free(tmp)
13043  *
13044  * cdef setitem_indexed(self, index, value): # <<<<<<<<<<<<<<
13045  * cdef char *itemp = self.get_item_pointer(index)
13046  * self.assign_item_from_object(itemp, value)
13047  */
13048 
13049  /* function exit code */
13050  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
13051  goto __pyx_L0;
13052  __pyx_L1_error:;
13053  __Pyx_XDECREF(__pyx_t_2);
13054  __Pyx_AddTraceback("View.MemoryView.memoryview.setitem_indexed", __pyx_clineno, __pyx_lineno, __pyx_filename);
13055  __pyx_r = 0;
13056  __pyx_L0:;
13057  __Pyx_XGIVEREF(__pyx_r);
13058  __Pyx_RefNannyFinishContext();
13059  return __pyx_r;
13060 }
13061 
13062 /* "View.MemoryView":481
13063  * self.assign_item_from_object(itemp, value)
13064  *
13065  * cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<<
13066  * """Only used if instantiated manually by the user, or if Cython doesn't
13067  * know how to convert the type"""
13068  */
13069 
13070 static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview_obj *__pyx_v_self, char *__pyx_v_itemp) {
13071  PyObject *__pyx_v_struct = NULL;
13072  PyObject *__pyx_v_bytesitem = 0;
13073  PyObject *__pyx_v_result = NULL;
13074  PyObject *__pyx_r = NULL;
13075  __Pyx_RefNannyDeclarations
13076  PyObject *__pyx_t_1 = NULL;
13077  PyObject *__pyx_t_2 = NULL;
13078  PyObject *__pyx_t_3 = NULL;
13079  PyObject *__pyx_t_4 = NULL;
13080  PyObject *__pyx_t_5 = NULL;
13081  PyObject *__pyx_t_6 = NULL;
13082  PyObject *__pyx_t_7 = NULL;
13083  int __pyx_t_8;
13084  PyObject *__pyx_t_9 = NULL;
13085  size_t __pyx_t_10;
13086  int __pyx_t_11;
13087  __Pyx_RefNannySetupContext("convert_item_to_object", 0);
13088 
13089  /* "View.MemoryView":484
13090  * """Only used if instantiated manually by the user, or if Cython doesn't
13091  * know how to convert the type"""
13092  * import struct # <<<<<<<<<<<<<<
13093  * cdef bytes bytesitem
13094  *
13095  */
13096  __pyx_t_1 = __Pyx_Import(__pyx_n_s_struct, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 484, __pyx_L1_error)
13097  __Pyx_GOTREF(__pyx_t_1);
13098  __pyx_v_struct = __pyx_t_1;
13099  __pyx_t_1 = 0;
13100 
13101  /* "View.MemoryView":487
13102  * cdef bytes bytesitem
13103  *
13104  * bytesitem = itemp[:self.view.itemsize] # <<<<<<<<<<<<<<
13105  * try:
13106  * result = struct.unpack(self.view.format, bytesitem)
13107  */
13108  __pyx_t_1 = __Pyx_PyBytes_FromStringAndSize(__pyx_v_itemp + 0, __pyx_v_self->view.itemsize - 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 487, __pyx_L1_error)
13109  __Pyx_GOTREF(__pyx_t_1);
13110  __pyx_v_bytesitem = ((PyObject*)__pyx_t_1);
13111  __pyx_t_1 = 0;
13112 
13113  /* "View.MemoryView":488
13114  *
13115  * bytesitem = itemp[:self.view.itemsize]
13116  * try: # <<<<<<<<<<<<<<
13117  * result = struct.unpack(self.view.format, bytesitem)
13118  * except struct.error:
13119  */
13120  {
13121  __Pyx_PyThreadState_declare
13122  __Pyx_PyThreadState_assign
13123  __Pyx_ExceptionSave(&__pyx_t_2, &__pyx_t_3, &__pyx_t_4);
13124  __Pyx_XGOTREF(__pyx_t_2);
13125  __Pyx_XGOTREF(__pyx_t_3);
13126  __Pyx_XGOTREF(__pyx_t_4);
13127  /*try:*/ {
13128 
13129  /* "View.MemoryView":489
13130  * bytesitem = itemp[:self.view.itemsize]
13131  * try:
13132  * result = struct.unpack(self.view.format, bytesitem) # <<<<<<<<<<<<<<
13133  * except struct.error:
13134  * raise ValueError("Unable to convert item to object")
13135  */
13136  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_unpack); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 489, __pyx_L3_error)
13137  __Pyx_GOTREF(__pyx_t_5);
13138  __pyx_t_6 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 489, __pyx_L3_error)
13139  __Pyx_GOTREF(__pyx_t_6);
13140  __pyx_t_7 = NULL;
13141  __pyx_t_8 = 0;
13142  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
13143  __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5);
13144  if (likely(__pyx_t_7)) {
13145  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
13146  __Pyx_INCREF(__pyx_t_7);
13147  __Pyx_INCREF(function);
13148  __Pyx_DECREF_SET(__pyx_t_5, function);
13149  __pyx_t_8 = 1;
13150  }
13151  }
13152  #if CYTHON_FAST_PYCALL
13153  if (PyFunction_Check(__pyx_t_5)) {
13154  PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_6, __pyx_v_bytesitem};
13155  __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 489, __pyx_L3_error)
13156  __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
13157  __Pyx_GOTREF(__pyx_t_1);
13158  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
13159  } else
13160  #endif
13161  #if CYTHON_FAST_PYCCALL
13162  if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
13163  PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_6, __pyx_v_bytesitem};
13164  __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 489, __pyx_L3_error)
13165  __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
13166  __Pyx_GOTREF(__pyx_t_1);
13167  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
13168  } else
13169  #endif
13170  {
13171  __pyx_t_9 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 489, __pyx_L3_error)
13172  __Pyx_GOTREF(__pyx_t_9);
13173  if (__pyx_t_7) {
13174  __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); __pyx_t_7 = NULL;
13175  }
13176  __Pyx_GIVEREF(__pyx_t_6);
13177  PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_8, __pyx_t_6);
13178  __Pyx_INCREF(__pyx_v_bytesitem);
13179  __Pyx_GIVEREF(__pyx_v_bytesitem);
13180  PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __pyx_v_bytesitem);
13181  __pyx_t_6 = 0;
13182  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_9, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 489, __pyx_L3_error)
13183  __Pyx_GOTREF(__pyx_t_1);
13184  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
13185  }
13186  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
13187  __pyx_v_result = __pyx_t_1;
13188  __pyx_t_1 = 0;
13189 
13190  /* "View.MemoryView":488
13191  *
13192  * bytesitem = itemp[:self.view.itemsize]
13193  * try: # <<<<<<<<<<<<<<
13194  * result = struct.unpack(self.view.format, bytesitem)
13195  * except struct.error:
13196  */
13197  }
13198 
13199  /* "View.MemoryView":493
13200  * raise ValueError("Unable to convert item to object")
13201  * else:
13202  * if len(self.view.format) == 1: # <<<<<<<<<<<<<<
13203  * return result[0]
13204  * return result
13205  */
13206  /*else:*/ {
13207  __pyx_t_10 = strlen(__pyx_v_self->view.format);
13208  __pyx_t_11 = ((__pyx_t_10 == 1) != 0);
13209  if (__pyx_t_11) {
13210 
13211  /* "View.MemoryView":494
13212  * else:
13213  * if len(self.view.format) == 1:
13214  * return result[0] # <<<<<<<<<<<<<<
13215  * return result
13216  *
13217  */
13218  __Pyx_XDECREF(__pyx_r);
13219  __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_result, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 494, __pyx_L5_except_error)
13220  __Pyx_GOTREF(__pyx_t_1);
13221  __pyx_r = __pyx_t_1;
13222  __pyx_t_1 = 0;
13223  goto __pyx_L6_except_return;
13224 
13225  /* "View.MemoryView":493
13226  * raise ValueError("Unable to convert item to object")
13227  * else:
13228  * if len(self.view.format) == 1: # <<<<<<<<<<<<<<
13229  * return result[0]
13230  * return result
13231  */
13232  }
13233 
13234  /* "View.MemoryView":495
13235  * if len(self.view.format) == 1:
13236  * return result[0]
13237  * return result # <<<<<<<<<<<<<<
13238  *
13239  * cdef assign_item_from_object(self, char *itemp, object value):
13240  */
13241  __Pyx_XDECREF(__pyx_r);
13242  __Pyx_INCREF(__pyx_v_result);
13243  __pyx_r = __pyx_v_result;
13244  goto __pyx_L6_except_return;
13245  }
13246  __pyx_L3_error:;
13247  __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
13248  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
13249  __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
13250  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
13251  __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
13252 
13253  /* "View.MemoryView":490
13254  * try:
13255  * result = struct.unpack(self.view.format, bytesitem)
13256  * except struct.error: # <<<<<<<<<<<<<<
13257  * raise ValueError("Unable to convert item to object")
13258  * else:
13259  */
13260  __Pyx_ErrFetch(&__pyx_t_1, &__pyx_t_5, &__pyx_t_9);
13261  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_error); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 490, __pyx_L5_except_error)
13262  __Pyx_GOTREF(__pyx_t_6);
13263  __pyx_t_8 = __Pyx_PyErr_GivenExceptionMatches(__pyx_t_1, __pyx_t_6);
13264  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
13265  __Pyx_ErrRestore(__pyx_t_1, __pyx_t_5, __pyx_t_9);
13266  __pyx_t_1 = 0; __pyx_t_5 = 0; __pyx_t_9 = 0;
13267  if (__pyx_t_8) {
13268  __Pyx_AddTraceback("View.MemoryView.memoryview.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
13269  if (__Pyx_GetException(&__pyx_t_9, &__pyx_t_5, &__pyx_t_1) < 0) __PYX_ERR(2, 490, __pyx_L5_except_error)
13270  __Pyx_GOTREF(__pyx_t_9);
13271  __Pyx_GOTREF(__pyx_t_5);
13272  __Pyx_GOTREF(__pyx_t_1);
13273 
13274  /* "View.MemoryView":491
13275  * result = struct.unpack(self.view.format, bytesitem)
13276  * except struct.error:
13277  * raise ValueError("Unable to convert item to object") # <<<<<<<<<<<<<<
13278  * else:
13279  * if len(self.view.format) == 1:
13280  */
13281  __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__16, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 491, __pyx_L5_except_error)
13282  __Pyx_GOTREF(__pyx_t_6);
13283  __Pyx_Raise(__pyx_t_6, 0, 0, 0);
13284  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
13285  __PYX_ERR(2, 491, __pyx_L5_except_error)
13286  }
13287  goto __pyx_L5_except_error;
13288  __pyx_L5_except_error:;
13289 
13290  /* "View.MemoryView":488
13291  *
13292  * bytesitem = itemp[:self.view.itemsize]
13293  * try: # <<<<<<<<<<<<<<
13294  * result = struct.unpack(self.view.format, bytesitem)
13295  * except struct.error:
13296  */
13297  __Pyx_XGIVEREF(__pyx_t_2);
13298  __Pyx_XGIVEREF(__pyx_t_3);
13299  __Pyx_XGIVEREF(__pyx_t_4);
13300  __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
13301  goto __pyx_L1_error;
13302  __pyx_L6_except_return:;
13303  __Pyx_XGIVEREF(__pyx_t_2);
13304  __Pyx_XGIVEREF(__pyx_t_3);
13305  __Pyx_XGIVEREF(__pyx_t_4);
13306  __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
13307  goto __pyx_L0;
13308  }
13309 
13310  /* "View.MemoryView":481
13311  * self.assign_item_from_object(itemp, value)
13312  *
13313  * cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<<
13314  * """Only used if instantiated manually by the user, or if Cython doesn't
13315  * know how to convert the type"""
13316  */
13317 
13318  /* function exit code */
13319  __pyx_L1_error:;
13320  __Pyx_XDECREF(__pyx_t_1);
13321  __Pyx_XDECREF(__pyx_t_5);
13322  __Pyx_XDECREF(__pyx_t_6);
13323  __Pyx_XDECREF(__pyx_t_7);
13324  __Pyx_XDECREF(__pyx_t_9);
13325  __Pyx_AddTraceback("View.MemoryView.memoryview.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
13326  __pyx_r = 0;
13327  __pyx_L0:;
13328  __Pyx_XDECREF(__pyx_v_struct);
13329  __Pyx_XDECREF(__pyx_v_bytesitem);
13330  __Pyx_XDECREF(__pyx_v_result);
13331  __Pyx_XGIVEREF(__pyx_r);
13332  __Pyx_RefNannyFinishContext();
13333  return __pyx_r;
13334 }
13335 
13336 /* "View.MemoryView":497
13337  * return result
13338  *
13339  * cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<<
13340  * """Only used if instantiated manually by the user, or if Cython doesn't
13341  * know how to convert the type"""
13342  */
13343 
13344 static PyObject *__pyx_memoryview_assign_item_from_object(struct __pyx_memoryview_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value) {
13345  PyObject *__pyx_v_struct = NULL;
13346  char __pyx_v_c;
13347  PyObject *__pyx_v_bytesvalue = 0;
13348  Py_ssize_t __pyx_v_i;
13349  PyObject *__pyx_r = NULL;
13350  __Pyx_RefNannyDeclarations
13351  PyObject *__pyx_t_1 = NULL;
13352  int __pyx_t_2;
13353  int __pyx_t_3;
13354  PyObject *__pyx_t_4 = NULL;
13355  PyObject *__pyx_t_5 = NULL;
13356  PyObject *__pyx_t_6 = NULL;
13357  int __pyx_t_7;
13358  PyObject *__pyx_t_8 = NULL;
13359  Py_ssize_t __pyx_t_9;
13360  PyObject *__pyx_t_10 = NULL;
13361  char *__pyx_t_11;
13362  char *__pyx_t_12;
13363  char *__pyx_t_13;
13364  char *__pyx_t_14;
13365  __Pyx_RefNannySetupContext("assign_item_from_object", 0);
13366 
13367  /* "View.MemoryView":500
13368  * """Only used if instantiated manually by the user, or if Cython doesn't
13369  * know how to convert the type"""
13370  * import struct # <<<<<<<<<<<<<<
13371  * cdef char c
13372  * cdef bytes bytesvalue
13373  */
13374  __pyx_t_1 = __Pyx_Import(__pyx_n_s_struct, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 500, __pyx_L1_error)
13375  __Pyx_GOTREF(__pyx_t_1);
13376  __pyx_v_struct = __pyx_t_1;
13377  __pyx_t_1 = 0;
13378 
13379  /* "View.MemoryView":505
13380  * cdef Py_ssize_t i
13381  *
13382  * if isinstance(value, tuple): # <<<<<<<<<<<<<<
13383  * bytesvalue = struct.pack(self.view.format, *value)
13384  * else:
13385  */
13386  __pyx_t_2 = PyTuple_Check(__pyx_v_value);
13387  __pyx_t_3 = (__pyx_t_2 != 0);
13388  if (__pyx_t_3) {
13389 
13390  /* "View.MemoryView":506
13391  *
13392  * if isinstance(value, tuple):
13393  * bytesvalue = struct.pack(self.view.format, *value) # <<<<<<<<<<<<<<
13394  * else:
13395  * bytesvalue = struct.pack(self.view.format, value)
13396  */
13397  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_pack); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 506, __pyx_L1_error)
13398  __Pyx_GOTREF(__pyx_t_1);
13399  __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 506, __pyx_L1_error)
13400  __Pyx_GOTREF(__pyx_t_4);
13401  __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 506, __pyx_L1_error)
13402  __Pyx_GOTREF(__pyx_t_5);
13403  __Pyx_GIVEREF(__pyx_t_4);
13404  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4);
13405  __pyx_t_4 = 0;
13406  __pyx_t_4 = __Pyx_PySequence_Tuple(__pyx_v_value); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 506, __pyx_L1_error)
13407  __Pyx_GOTREF(__pyx_t_4);
13408  __pyx_t_6 = PyNumber_Add(__pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 506, __pyx_L1_error)
13409  __Pyx_GOTREF(__pyx_t_6);
13410  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
13411  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
13412  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_6, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 506, __pyx_L1_error)
13413  __Pyx_GOTREF(__pyx_t_4);
13414  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13415  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
13416  if (!(likely(PyBytes_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_4)->tp_name), 0))) __PYX_ERR(2, 506, __pyx_L1_error)
13417  __pyx_v_bytesvalue = ((PyObject*)__pyx_t_4);
13418  __pyx_t_4 = 0;
13419 
13420  /* "View.MemoryView":505
13421  * cdef Py_ssize_t i
13422  *
13423  * if isinstance(value, tuple): # <<<<<<<<<<<<<<
13424  * bytesvalue = struct.pack(self.view.format, *value)
13425  * else:
13426  */
13427  goto __pyx_L3;
13428  }
13429 
13430  /* "View.MemoryView":508
13431  * bytesvalue = struct.pack(self.view.format, *value)
13432  * else:
13433  * bytesvalue = struct.pack(self.view.format, value) # <<<<<<<<<<<<<<
13434  *
13435  * for i, c in enumerate(bytesvalue):
13436  */
13437  /*else*/ {
13438  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_pack); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 508, __pyx_L1_error)
13439  __Pyx_GOTREF(__pyx_t_6);
13440  __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 508, __pyx_L1_error)
13441  __Pyx_GOTREF(__pyx_t_1);
13442  __pyx_t_5 = NULL;
13443  __pyx_t_7 = 0;
13444  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
13445  __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
13446  if (likely(__pyx_t_5)) {
13447  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
13448  __Pyx_INCREF(__pyx_t_5);
13449  __Pyx_INCREF(function);
13450  __Pyx_DECREF_SET(__pyx_t_6, function);
13451  __pyx_t_7 = 1;
13452  }
13453  }
13454  #if CYTHON_FAST_PYCALL
13455  if (PyFunction_Check(__pyx_t_6)) {
13456  PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_1, __pyx_v_value};
13457  __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 508, __pyx_L1_error)
13458  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
13459  __Pyx_GOTREF(__pyx_t_4);
13460  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13461  } else
13462  #endif
13463  #if CYTHON_FAST_PYCCALL
13464  if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
13465  PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_1, __pyx_v_value};
13466  __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 508, __pyx_L1_error)
13467  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
13468  __Pyx_GOTREF(__pyx_t_4);
13469  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13470  } else
13471  #endif
13472  {
13473  __pyx_t_8 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 508, __pyx_L1_error)
13474  __Pyx_GOTREF(__pyx_t_8);
13475  if (__pyx_t_5) {
13476  __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_5); __pyx_t_5 = NULL;
13477  }
13478  __Pyx_GIVEREF(__pyx_t_1);
13479  PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_7, __pyx_t_1);
13480  __Pyx_INCREF(__pyx_v_value);
13481  __Pyx_GIVEREF(__pyx_v_value);
13482  PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_v_value);
13483  __pyx_t_1 = 0;
13484  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_8, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 508, __pyx_L1_error)
13485  __Pyx_GOTREF(__pyx_t_4);
13486  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
13487  }
13488  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
13489  if (!(likely(PyBytes_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_4)->tp_name), 0))) __PYX_ERR(2, 508, __pyx_L1_error)
13490  __pyx_v_bytesvalue = ((PyObject*)__pyx_t_4);
13491  __pyx_t_4 = 0;
13492  }
13493  __pyx_L3:;
13494 
13495  /* "View.MemoryView":510
13496  * bytesvalue = struct.pack(self.view.format, value)
13497  *
13498  * for i, c in enumerate(bytesvalue): # <<<<<<<<<<<<<<
13499  * itemp[i] = c
13500  *
13501  */
13502  __pyx_t_9 = 0;
13503  if (unlikely(__pyx_v_bytesvalue == Py_None)) {
13504  PyErr_SetString(PyExc_TypeError, "'NoneType' is not iterable");
13505  __PYX_ERR(2, 510, __pyx_L1_error)
13506  }
13507  __Pyx_INCREF(__pyx_v_bytesvalue);
13508  __pyx_t_10 = __pyx_v_bytesvalue;
13509  __pyx_t_12 = PyBytes_AS_STRING(__pyx_t_10);
13510  __pyx_t_13 = (__pyx_t_12 + PyBytes_GET_SIZE(__pyx_t_10));
13511  for (__pyx_t_14 = __pyx_t_12; __pyx_t_14 < __pyx_t_13; __pyx_t_14++) {
13512  __pyx_t_11 = __pyx_t_14;
13513  __pyx_v_c = (__pyx_t_11[0]);
13514 
13515  /* "View.MemoryView":511
13516  *
13517  * for i, c in enumerate(bytesvalue):
13518  * itemp[i] = c # <<<<<<<<<<<<<<
13519  *
13520  * @cname('getbuffer')
13521  */
13522  __pyx_v_i = __pyx_t_9;
13523 
13524  /* "View.MemoryView":510
13525  * bytesvalue = struct.pack(self.view.format, value)
13526  *
13527  * for i, c in enumerate(bytesvalue): # <<<<<<<<<<<<<<
13528  * itemp[i] = c
13529  *
13530  */
13531  __pyx_t_9 = (__pyx_t_9 + 1);
13532 
13533  /* "View.MemoryView":511
13534  *
13535  * for i, c in enumerate(bytesvalue):
13536  * itemp[i] = c # <<<<<<<<<<<<<<
13537  *
13538  * @cname('getbuffer')
13539  */
13540  (__pyx_v_itemp[__pyx_v_i]) = __pyx_v_c;
13541  }
13542  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
13543 
13544  /* "View.MemoryView":497
13545  * return result
13546  *
13547  * cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<<
13548  * """Only used if instantiated manually by the user, or if Cython doesn't
13549  * know how to convert the type"""
13550  */
13551 
13552  /* function exit code */
13553  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
13554  goto __pyx_L0;
13555  __pyx_L1_error:;
13556  __Pyx_XDECREF(__pyx_t_1);
13557  __Pyx_XDECREF(__pyx_t_4);
13558  __Pyx_XDECREF(__pyx_t_5);
13559  __Pyx_XDECREF(__pyx_t_6);
13560  __Pyx_XDECREF(__pyx_t_8);
13561  __Pyx_XDECREF(__pyx_t_10);
13562  __Pyx_AddTraceback("View.MemoryView.memoryview.assign_item_from_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
13563  __pyx_r = 0;
13564  __pyx_L0:;
13565  __Pyx_XDECREF(__pyx_v_struct);
13566  __Pyx_XDECREF(__pyx_v_bytesvalue);
13567  __Pyx_XGIVEREF(__pyx_r);
13568  __Pyx_RefNannyFinishContext();
13569  return __pyx_r;
13570 }
13571 
13572 /* "View.MemoryView":514
13573  *
13574  * @cname('getbuffer')
13575  * def __getbuffer__(self, Py_buffer *info, int flags): # <<<<<<<<<<<<<<
13576  * if flags & PyBUF_WRITABLE and self.view.readonly:
13577  * raise ValueError("Cannot create writable memory view from read-only memoryview")
13578  */
13579 
13580 /* Python wrapper */
13581 static CYTHON_UNUSED int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
13582 static CYTHON_UNUSED int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
13583  int __pyx_r;
13584  __Pyx_RefNannyDeclarations
13585  __Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0);
13586  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbuffer__(((struct __pyx_memoryview_obj *)__pyx_v_self), ((Py_buffer *)__pyx_v_info), ((int)__pyx_v_flags));
13587 
13588  /* function exit code */
13589  __Pyx_RefNannyFinishContext();
13590  return __pyx_r;
13591 }
13592 
13593 static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbuffer__(struct __pyx_memoryview_obj *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
13594  int __pyx_r;
13595  __Pyx_RefNannyDeclarations
13596  int __pyx_t_1;
13597  int __pyx_t_2;
13598  PyObject *__pyx_t_3 = NULL;
13599  Py_ssize_t *__pyx_t_4;
13600  char *__pyx_t_5;
13601  void *__pyx_t_6;
13602  int __pyx_t_7;
13603  Py_ssize_t __pyx_t_8;
13604  if (__pyx_v_info == NULL) {
13605  PyErr_SetString(PyExc_BufferError, "PyObject_GetBuffer: view==NULL argument is obsolete");
13606  return -1;
13607  }
13608  __Pyx_RefNannySetupContext("__getbuffer__", 0);
13609  __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None);
13610  __Pyx_GIVEREF(__pyx_v_info->obj);
13611 
13612  /* "View.MemoryView":515
13613  * @cname('getbuffer')
13614  * def __getbuffer__(self, Py_buffer *info, int flags):
13615  * if flags & PyBUF_WRITABLE and self.view.readonly: # <<<<<<<<<<<<<<
13616  * raise ValueError("Cannot create writable memory view from read-only memoryview")
13617  *
13618  */
13619  __pyx_t_2 = ((__pyx_v_flags & PyBUF_WRITABLE) != 0);
13620  if (__pyx_t_2) {
13621  } else {
13622  __pyx_t_1 = __pyx_t_2;
13623  goto __pyx_L4_bool_binop_done;
13624  }
13625  __pyx_t_2 = (__pyx_v_self->view.readonly != 0);
13626  __pyx_t_1 = __pyx_t_2;
13627  __pyx_L4_bool_binop_done:;
13628  if (unlikely(__pyx_t_1)) {
13629 
13630  /* "View.MemoryView":516
13631  * def __getbuffer__(self, Py_buffer *info, int flags):
13632  * if flags & PyBUF_WRITABLE and self.view.readonly:
13633  * raise ValueError("Cannot create writable memory view from read-only memoryview") # <<<<<<<<<<<<<<
13634  *
13635  * if flags & PyBUF_ND:
13636  */
13637  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__17, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 516, __pyx_L1_error)
13638  __Pyx_GOTREF(__pyx_t_3);
13639  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
13640  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
13641  __PYX_ERR(2, 516, __pyx_L1_error)
13642 
13643  /* "View.MemoryView":515
13644  * @cname('getbuffer')
13645  * def __getbuffer__(self, Py_buffer *info, int flags):
13646  * if flags & PyBUF_WRITABLE and self.view.readonly: # <<<<<<<<<<<<<<
13647  * raise ValueError("Cannot create writable memory view from read-only memoryview")
13648  *
13649  */
13650  }
13651 
13652  /* "View.MemoryView":518
13653  * raise ValueError("Cannot create writable memory view from read-only memoryview")
13654  *
13655  * if flags & PyBUF_ND: # <<<<<<<<<<<<<<
13656  * info.shape = self.view.shape
13657  * else:
13658  */
13659  __pyx_t_1 = ((__pyx_v_flags & PyBUF_ND) != 0);
13660  if (__pyx_t_1) {
13661 
13662  /* "View.MemoryView":519
13663  *
13664  * if flags & PyBUF_ND:
13665  * info.shape = self.view.shape # <<<<<<<<<<<<<<
13666  * else:
13667  * info.shape = NULL
13668  */
13669  __pyx_t_4 = __pyx_v_self->view.shape;
13670  __pyx_v_info->shape = __pyx_t_4;
13671 
13672  /* "View.MemoryView":518
13673  * raise ValueError("Cannot create writable memory view from read-only memoryview")
13674  *
13675  * if flags & PyBUF_ND: # <<<<<<<<<<<<<<
13676  * info.shape = self.view.shape
13677  * else:
13678  */
13679  goto __pyx_L6;
13680  }
13681 
13682  /* "View.MemoryView":521
13683  * info.shape = self.view.shape
13684  * else:
13685  * info.shape = NULL # <<<<<<<<<<<<<<
13686  *
13687  * if flags & PyBUF_STRIDES:
13688  */
13689  /*else*/ {
13690  __pyx_v_info->shape = NULL;
13691  }
13692  __pyx_L6:;
13693 
13694  /* "View.MemoryView":523
13695  * info.shape = NULL
13696  *
13697  * if flags & PyBUF_STRIDES: # <<<<<<<<<<<<<<
13698  * info.strides = self.view.strides
13699  * else:
13700  */
13701  __pyx_t_1 = ((__pyx_v_flags & PyBUF_STRIDES) != 0);
13702  if (__pyx_t_1) {
13703 
13704  /* "View.MemoryView":524
13705  *
13706  * if flags & PyBUF_STRIDES:
13707  * info.strides = self.view.strides # <<<<<<<<<<<<<<
13708  * else:
13709  * info.strides = NULL
13710  */
13711  __pyx_t_4 = __pyx_v_self->view.strides;
13712  __pyx_v_info->strides = __pyx_t_4;
13713 
13714  /* "View.MemoryView":523
13715  * info.shape = NULL
13716  *
13717  * if flags & PyBUF_STRIDES: # <<<<<<<<<<<<<<
13718  * info.strides = self.view.strides
13719  * else:
13720  */
13721  goto __pyx_L7;
13722  }
13723 
13724  /* "View.MemoryView":526
13725  * info.strides = self.view.strides
13726  * else:
13727  * info.strides = NULL # <<<<<<<<<<<<<<
13728  *
13729  * if flags & PyBUF_INDIRECT:
13730  */
13731  /*else*/ {
13732  __pyx_v_info->strides = NULL;
13733  }
13734  __pyx_L7:;
13735 
13736  /* "View.MemoryView":528
13737  * info.strides = NULL
13738  *
13739  * if flags & PyBUF_INDIRECT: # <<<<<<<<<<<<<<
13740  * info.suboffsets = self.view.suboffsets
13741  * else:
13742  */
13743  __pyx_t_1 = ((__pyx_v_flags & PyBUF_INDIRECT) != 0);
13744  if (__pyx_t_1) {
13745 
13746  /* "View.MemoryView":529
13747  *
13748  * if flags & PyBUF_INDIRECT:
13749  * info.suboffsets = self.view.suboffsets # <<<<<<<<<<<<<<
13750  * else:
13751  * info.suboffsets = NULL
13752  */
13753  __pyx_t_4 = __pyx_v_self->view.suboffsets;
13754  __pyx_v_info->suboffsets = __pyx_t_4;
13755 
13756  /* "View.MemoryView":528
13757  * info.strides = NULL
13758  *
13759  * if flags & PyBUF_INDIRECT: # <<<<<<<<<<<<<<
13760  * info.suboffsets = self.view.suboffsets
13761  * else:
13762  */
13763  goto __pyx_L8;
13764  }
13765 
13766  /* "View.MemoryView":531
13767  * info.suboffsets = self.view.suboffsets
13768  * else:
13769  * info.suboffsets = NULL # <<<<<<<<<<<<<<
13770  *
13771  * if flags & PyBUF_FORMAT:
13772  */
13773  /*else*/ {
13774  __pyx_v_info->suboffsets = NULL;
13775  }
13776  __pyx_L8:;
13777 
13778  /* "View.MemoryView":533
13779  * info.suboffsets = NULL
13780  *
13781  * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
13782  * info.format = self.view.format
13783  * else:
13784  */
13785  __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0);
13786  if (__pyx_t_1) {
13787 
13788  /* "View.MemoryView":534
13789  *
13790  * if flags & PyBUF_FORMAT:
13791  * info.format = self.view.format # <<<<<<<<<<<<<<
13792  * else:
13793  * info.format = NULL
13794  */
13795  __pyx_t_5 = __pyx_v_self->view.format;
13796  __pyx_v_info->format = __pyx_t_5;
13797 
13798  /* "View.MemoryView":533
13799  * info.suboffsets = NULL
13800  *
13801  * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
13802  * info.format = self.view.format
13803  * else:
13804  */
13805  goto __pyx_L9;
13806  }
13807 
13808  /* "View.MemoryView":536
13809  * info.format = self.view.format
13810  * else:
13811  * info.format = NULL # <<<<<<<<<<<<<<
13812  *
13813  * info.buf = self.view.buf
13814  */
13815  /*else*/ {
13816  __pyx_v_info->format = NULL;
13817  }
13818  __pyx_L9:;
13819 
13820  /* "View.MemoryView":538
13821  * info.format = NULL
13822  *
13823  * info.buf = self.view.buf # <<<<<<<<<<<<<<
13824  * info.ndim = self.view.ndim
13825  * info.itemsize = self.view.itemsize
13826  */
13827  __pyx_t_6 = __pyx_v_self->view.buf;
13828  __pyx_v_info->buf = __pyx_t_6;
13829 
13830  /* "View.MemoryView":539
13831  *
13832  * info.buf = self.view.buf
13833  * info.ndim = self.view.ndim # <<<<<<<<<<<<<<
13834  * info.itemsize = self.view.itemsize
13835  * info.len = self.view.len
13836  */
13837  __pyx_t_7 = __pyx_v_self->view.ndim;
13838  __pyx_v_info->ndim = __pyx_t_7;
13839 
13840  /* "View.MemoryView":540
13841  * info.buf = self.view.buf
13842  * info.ndim = self.view.ndim
13843  * info.itemsize = self.view.itemsize # <<<<<<<<<<<<<<
13844  * info.len = self.view.len
13845  * info.readonly = self.view.readonly
13846  */
13847  __pyx_t_8 = __pyx_v_self->view.itemsize;
13848  __pyx_v_info->itemsize = __pyx_t_8;
13849 
13850  /* "View.MemoryView":541
13851  * info.ndim = self.view.ndim
13852  * info.itemsize = self.view.itemsize
13853  * info.len = self.view.len # <<<<<<<<<<<<<<
13854  * info.readonly = self.view.readonly
13855  * info.obj = self
13856  */
13857  __pyx_t_8 = __pyx_v_self->view.len;
13858  __pyx_v_info->len = __pyx_t_8;
13859 
13860  /* "View.MemoryView":542
13861  * info.itemsize = self.view.itemsize
13862  * info.len = self.view.len
13863  * info.readonly = self.view.readonly # <<<<<<<<<<<<<<
13864  * info.obj = self
13865  *
13866  */
13867  __pyx_t_1 = __pyx_v_self->view.readonly;
13868  __pyx_v_info->readonly = __pyx_t_1;
13869 
13870  /* "View.MemoryView":543
13871  * info.len = self.view.len
13872  * info.readonly = self.view.readonly
13873  * info.obj = self # <<<<<<<<<<<<<<
13874  *
13875  * __pyx_getbuffer = capsule(<void *> &__pyx_memoryview_getbuffer, "getbuffer(obj, view, flags)")
13876  */
13877  __Pyx_INCREF(((PyObject *)__pyx_v_self));
13878  __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
13879  __Pyx_GOTREF(__pyx_v_info->obj);
13880  __Pyx_DECREF(__pyx_v_info->obj);
13881  __pyx_v_info->obj = ((PyObject *)__pyx_v_self);
13882 
13883  /* "View.MemoryView":514
13884  *
13885  * @cname('getbuffer')
13886  * def __getbuffer__(self, Py_buffer *info, int flags): # <<<<<<<<<<<<<<
13887  * if flags & PyBUF_WRITABLE and self.view.readonly:
13888  * raise ValueError("Cannot create writable memory view from read-only memoryview")
13889  */
13890 
13891  /* function exit code */
13892  __pyx_r = 0;
13893  goto __pyx_L0;
13894  __pyx_L1_error:;
13895  __Pyx_XDECREF(__pyx_t_3);
13896  __Pyx_AddTraceback("View.MemoryView.memoryview.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13897  __pyx_r = -1;
13898  if (__pyx_v_info->obj != NULL) {
13899  __Pyx_GOTREF(__pyx_v_info->obj);
13900  __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
13901  }
13902  goto __pyx_L2;
13903  __pyx_L0:;
13904  if (__pyx_v_info->obj == Py_None) {
13905  __Pyx_GOTREF(__pyx_v_info->obj);
13906  __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
13907  }
13908  __pyx_L2:;
13909  __Pyx_RefNannyFinishContext();
13910  return __pyx_r;
13911 }
13912 
13913 /* "View.MemoryView":549
13914  *
13915  * @property
13916  * def T(self): # <<<<<<<<<<<<<<
13917  * cdef _memoryviewslice result = memoryview_copy(self)
13918  * transpose_memslice(&result.from_slice)
13919  */
13920 
13921 /* Python wrapper */
13922 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_1T_1__get__(PyObject *__pyx_v_self); /*proto*/
13923 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_1T_1__get__(PyObject *__pyx_v_self) {
13924  PyObject *__pyx_r = 0;
13925  __Pyx_RefNannyDeclarations
13926  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
13927  __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
13928 
13929  /* function exit code */
13930  __Pyx_RefNannyFinishContext();
13931  return __pyx_r;
13932 }
13933 
13934 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
13935  struct __pyx_memoryviewslice_obj *__pyx_v_result = 0;
13936  PyObject *__pyx_r = NULL;
13937  __Pyx_RefNannyDeclarations
13938  PyObject *__pyx_t_1 = NULL;
13939  int __pyx_t_2;
13940  __Pyx_RefNannySetupContext("__get__", 0);
13941 
13942  /* "View.MemoryView":550
13943  * @property
13944  * def T(self):
13945  * cdef _memoryviewslice result = memoryview_copy(self) # <<<<<<<<<<<<<<
13946  * transpose_memslice(&result.from_slice)
13947  * return result
13948  */
13949  __pyx_t_1 = __pyx_memoryview_copy_object(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 550, __pyx_L1_error)
13950  __Pyx_GOTREF(__pyx_t_1);
13951  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_memoryviewslice_type))))) __PYX_ERR(2, 550, __pyx_L1_error)
13952  __pyx_v_result = ((struct __pyx_memoryviewslice_obj *)__pyx_t_1);
13953  __pyx_t_1 = 0;
13954 
13955  /* "View.MemoryView":551
13956  * def T(self):
13957  * cdef _memoryviewslice result = memoryview_copy(self)
13958  * transpose_memslice(&result.from_slice) # <<<<<<<<<<<<<<
13959  * return result
13960  *
13961  */
13962  __pyx_t_2 = __pyx_memslice_transpose((&__pyx_v_result->from_slice)); if (unlikely(__pyx_t_2 == ((int)0))) __PYX_ERR(2, 551, __pyx_L1_error)
13963 
13964  /* "View.MemoryView":552
13965  * cdef _memoryviewslice result = memoryview_copy(self)
13966  * transpose_memslice(&result.from_slice)
13967  * return result # <<<<<<<<<<<<<<
13968  *
13969  * @property
13970  */
13971  __Pyx_XDECREF(__pyx_r);
13972  __Pyx_INCREF(((PyObject *)__pyx_v_result));
13973  __pyx_r = ((PyObject *)__pyx_v_result);
13974  goto __pyx_L0;
13975 
13976  /* "View.MemoryView":549
13977  *
13978  * @property
13979  * def T(self): # <<<<<<<<<<<<<<
13980  * cdef _memoryviewslice result = memoryview_copy(self)
13981  * transpose_memslice(&result.from_slice)
13982  */
13983 
13984  /* function exit code */
13985  __pyx_L1_error:;
13986  __Pyx_XDECREF(__pyx_t_1);
13987  __Pyx_AddTraceback("View.MemoryView.memoryview.T.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13988  __pyx_r = NULL;
13989  __pyx_L0:;
13990  __Pyx_XDECREF((PyObject *)__pyx_v_result);
13991  __Pyx_XGIVEREF(__pyx_r);
13992  __Pyx_RefNannyFinishContext();
13993  return __pyx_r;
13994 }
13995 
13996 /* "View.MemoryView":555
13997  *
13998  * @property
13999  * def base(self): # <<<<<<<<<<<<<<
14000  * return self.obj
14001  *
14002  */
14003 
14004 /* Python wrapper */
14005 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4base_1__get__(PyObject *__pyx_v_self); /*proto*/
14006 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4base_1__get__(PyObject *__pyx_v_self) {
14007  PyObject *__pyx_r = 0;
14008  __Pyx_RefNannyDeclarations
14009  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
14010  __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
14011 
14012  /* function exit code */
14013  __Pyx_RefNannyFinishContext();
14014  return __pyx_r;
14015 }
14016 
14017 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
14018  PyObject *__pyx_r = NULL;
14019  __Pyx_RefNannyDeclarations
14020  __Pyx_RefNannySetupContext("__get__", 0);
14021 
14022  /* "View.MemoryView":556
14023  * @property
14024  * def base(self):
14025  * return self.obj # <<<<<<<<<<<<<<
14026  *
14027  * @property
14028  */
14029  __Pyx_XDECREF(__pyx_r);
14030  __Pyx_INCREF(__pyx_v_self->obj);
14031  __pyx_r = __pyx_v_self->obj;
14032  goto __pyx_L0;
14033 
14034  /* "View.MemoryView":555
14035  *
14036  * @property
14037  * def base(self): # <<<<<<<<<<<<<<
14038  * return self.obj
14039  *
14040  */
14041 
14042  /* function exit code */
14043  __pyx_L0:;
14044  __Pyx_XGIVEREF(__pyx_r);
14045  __Pyx_RefNannyFinishContext();
14046  return __pyx_r;
14047 }
14048 
14049 /* "View.MemoryView":559
14050  *
14051  * @property
14052  * def shape(self): # <<<<<<<<<<<<<<
14053  * return tuple([length for length in self.view.shape[:self.view.ndim]])
14054  *
14055  */
14056 
14057 /* Python wrapper */
14058 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_5shape_1__get__(PyObject *__pyx_v_self); /*proto*/
14059 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_5shape_1__get__(PyObject *__pyx_v_self) {
14060  PyObject *__pyx_r = 0;
14061  __Pyx_RefNannyDeclarations
14062  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
14063  __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
14064 
14065  /* function exit code */
14066  __Pyx_RefNannyFinishContext();
14067  return __pyx_r;
14068 }
14069 
14070 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
14071  Py_ssize_t __pyx_v_length;
14072  PyObject *__pyx_r = NULL;
14073  __Pyx_RefNannyDeclarations
14074  PyObject *__pyx_t_1 = NULL;
14075  Py_ssize_t *__pyx_t_2;
14076  Py_ssize_t *__pyx_t_3;
14077  Py_ssize_t *__pyx_t_4;
14078  PyObject *__pyx_t_5 = NULL;
14079  __Pyx_RefNannySetupContext("__get__", 0);
14080 
14081  /* "View.MemoryView":560
14082  * @property
14083  * def shape(self):
14084  * return tuple([length for length in self.view.shape[:self.view.ndim]]) # <<<<<<<<<<<<<<
14085  *
14086  * @property
14087  */
14088  __Pyx_XDECREF(__pyx_r);
14089  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 560, __pyx_L1_error)
14090  __Pyx_GOTREF(__pyx_t_1);
14091  __pyx_t_3 = (__pyx_v_self->view.shape + __pyx_v_self->view.ndim);
14092  for (__pyx_t_4 = __pyx_v_self->view.shape; __pyx_t_4 < __pyx_t_3; __pyx_t_4++) {
14093  __pyx_t_2 = __pyx_t_4;
14094  __pyx_v_length = (__pyx_t_2[0]);
14095  __pyx_t_5 = PyInt_FromSsize_t(__pyx_v_length); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 560, __pyx_L1_error)
14096  __Pyx_GOTREF(__pyx_t_5);
14097  if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_5))) __PYX_ERR(2, 560, __pyx_L1_error)
14098  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
14099  }
14100  __pyx_t_5 = PyList_AsTuple(((PyObject*)__pyx_t_1)); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 560, __pyx_L1_error)
14101  __Pyx_GOTREF(__pyx_t_5);
14102  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14103  __pyx_r = __pyx_t_5;
14104  __pyx_t_5 = 0;
14105  goto __pyx_L0;
14106 
14107  /* "View.MemoryView":559
14108  *
14109  * @property
14110  * def shape(self): # <<<<<<<<<<<<<<
14111  * return tuple([length for length in self.view.shape[:self.view.ndim]])
14112  *
14113  */
14114 
14115  /* function exit code */
14116  __pyx_L1_error:;
14117  __Pyx_XDECREF(__pyx_t_1);
14118  __Pyx_XDECREF(__pyx_t_5);
14119  __Pyx_AddTraceback("View.MemoryView.memoryview.shape.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
14120  __pyx_r = NULL;
14121  __pyx_L0:;
14122  __Pyx_XGIVEREF(__pyx_r);
14123  __Pyx_RefNannyFinishContext();
14124  return __pyx_r;
14125 }
14126 
14127 /* "View.MemoryView":563
14128  *
14129  * @property
14130  * def strides(self): # <<<<<<<<<<<<<<
14131  * if self.view.strides == NULL:
14132  *
14133  */
14134 
14135 /* Python wrapper */
14136 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_7strides_1__get__(PyObject *__pyx_v_self); /*proto*/
14137 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_7strides_1__get__(PyObject *__pyx_v_self) {
14138  PyObject *__pyx_r = 0;
14139  __Pyx_RefNannyDeclarations
14140  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
14141  __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
14142 
14143  /* function exit code */
14144  __Pyx_RefNannyFinishContext();
14145  return __pyx_r;
14146 }
14147 
14148 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
14149  Py_ssize_t __pyx_v_stride;
14150  PyObject *__pyx_r = NULL;
14151  __Pyx_RefNannyDeclarations
14152  int __pyx_t_1;
14153  PyObject *__pyx_t_2 = NULL;
14154  Py_ssize_t *__pyx_t_3;
14155  Py_ssize_t *__pyx_t_4;
14156  Py_ssize_t *__pyx_t_5;
14157  PyObject *__pyx_t_6 = NULL;
14158  __Pyx_RefNannySetupContext("__get__", 0);
14159 
14160  /* "View.MemoryView":564
14161  * @property
14162  * def strides(self):
14163  * if self.view.strides == NULL: # <<<<<<<<<<<<<<
14164  *
14165  * raise ValueError("Buffer view does not expose strides")
14166  */
14167  __pyx_t_1 = ((__pyx_v_self->view.strides == NULL) != 0);
14168  if (unlikely(__pyx_t_1)) {
14169 
14170  /* "View.MemoryView":566
14171  * if self.view.strides == NULL:
14172  *
14173  * raise ValueError("Buffer view does not expose strides") # <<<<<<<<<<<<<<
14174  *
14175  * return tuple([stride for stride in self.view.strides[:self.view.ndim]])
14176  */
14177  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__18, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 566, __pyx_L1_error)
14178  __Pyx_GOTREF(__pyx_t_2);
14179  __Pyx_Raise(__pyx_t_2, 0, 0, 0);
14180  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14181  __PYX_ERR(2, 566, __pyx_L1_error)
14182 
14183  /* "View.MemoryView":564
14184  * @property
14185  * def strides(self):
14186  * if self.view.strides == NULL: # <<<<<<<<<<<<<<
14187  *
14188  * raise ValueError("Buffer view does not expose strides")
14189  */
14190  }
14191 
14192  /* "View.MemoryView":568
14193  * raise ValueError("Buffer view does not expose strides")
14194  *
14195  * return tuple([stride for stride in self.view.strides[:self.view.ndim]]) # <<<<<<<<<<<<<<
14196  *
14197  * @property
14198  */
14199  __Pyx_XDECREF(__pyx_r);
14200  __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 568, __pyx_L1_error)
14201  __Pyx_GOTREF(__pyx_t_2);
14202  __pyx_t_4 = (__pyx_v_self->view.strides + __pyx_v_self->view.ndim);
14203  for (__pyx_t_5 = __pyx_v_self->view.strides; __pyx_t_5 < __pyx_t_4; __pyx_t_5++) {
14204  __pyx_t_3 = __pyx_t_5;
14205  __pyx_v_stride = (__pyx_t_3[0]);
14206  __pyx_t_6 = PyInt_FromSsize_t(__pyx_v_stride); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 568, __pyx_L1_error)
14207  __Pyx_GOTREF(__pyx_t_6);
14208  if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_6))) __PYX_ERR(2, 568, __pyx_L1_error)
14209  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
14210  }
14211  __pyx_t_6 = PyList_AsTuple(((PyObject*)__pyx_t_2)); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 568, __pyx_L1_error)
14212  __Pyx_GOTREF(__pyx_t_6);
14213  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14214  __pyx_r = __pyx_t_6;
14215  __pyx_t_6 = 0;
14216  goto __pyx_L0;
14217 
14218  /* "View.MemoryView":563
14219  *
14220  * @property
14221  * def strides(self): # <<<<<<<<<<<<<<
14222  * if self.view.strides == NULL:
14223  *
14224  */
14225 
14226  /* function exit code */
14227  __pyx_L1_error:;
14228  __Pyx_XDECREF(__pyx_t_2);
14229  __Pyx_XDECREF(__pyx_t_6);
14230  __Pyx_AddTraceback("View.MemoryView.memoryview.strides.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
14231  __pyx_r = NULL;
14232  __pyx_L0:;
14233  __Pyx_XGIVEREF(__pyx_r);
14234  __Pyx_RefNannyFinishContext();
14235  return __pyx_r;
14236 }
14237 
14238 /* "View.MemoryView":571
14239  *
14240  * @property
14241  * def suboffsets(self): # <<<<<<<<<<<<<<
14242  * if self.view.suboffsets == NULL:
14243  * return (-1,) * self.view.ndim
14244  */
14245 
14246 /* Python wrapper */
14247 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_10suboffsets_1__get__(PyObject *__pyx_v_self); /*proto*/
14248 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_10suboffsets_1__get__(PyObject *__pyx_v_self) {
14249  PyObject *__pyx_r = 0;
14250  __Pyx_RefNannyDeclarations
14251  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
14252  __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
14253 
14254  /* function exit code */
14255  __Pyx_RefNannyFinishContext();
14256  return __pyx_r;
14257 }
14258 
14259 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
14260  Py_ssize_t __pyx_v_suboffset;
14261  PyObject *__pyx_r = NULL;
14262  __Pyx_RefNannyDeclarations
14263  int __pyx_t_1;
14264  PyObject *__pyx_t_2 = NULL;
14265  PyObject *__pyx_t_3 = NULL;
14266  Py_ssize_t *__pyx_t_4;
14267  Py_ssize_t *__pyx_t_5;
14268  Py_ssize_t *__pyx_t_6;
14269  __Pyx_RefNannySetupContext("__get__", 0);
14270 
14271  /* "View.MemoryView":572
14272  * @property
14273  * def suboffsets(self):
14274  * if self.view.suboffsets == NULL: # <<<<<<<<<<<<<<
14275  * return (-1,) * self.view.ndim
14276  *
14277  */
14278  __pyx_t_1 = ((__pyx_v_self->view.suboffsets == NULL) != 0);
14279  if (__pyx_t_1) {
14280 
14281  /* "View.MemoryView":573
14282  * def suboffsets(self):
14283  * if self.view.suboffsets == NULL:
14284  * return (-1,) * self.view.ndim # <<<<<<<<<<<<<<
14285  *
14286  * return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]])
14287  */
14288  __Pyx_XDECREF(__pyx_r);
14289  __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->view.ndim); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 573, __pyx_L1_error)
14290  __Pyx_GOTREF(__pyx_t_2);
14291  __pyx_t_3 = PyNumber_Multiply(__pyx_tuple__19, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 573, __pyx_L1_error)
14292  __Pyx_GOTREF(__pyx_t_3);
14293  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14294  __pyx_r = __pyx_t_3;
14295  __pyx_t_3 = 0;
14296  goto __pyx_L0;
14297 
14298  /* "View.MemoryView":572
14299  * @property
14300  * def suboffsets(self):
14301  * if self.view.suboffsets == NULL: # <<<<<<<<<<<<<<
14302  * return (-1,) * self.view.ndim
14303  *
14304  */
14305  }
14306 
14307  /* "View.MemoryView":575
14308  * return (-1,) * self.view.ndim
14309  *
14310  * return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]]) # <<<<<<<<<<<<<<
14311  *
14312  * @property
14313  */
14314  __Pyx_XDECREF(__pyx_r);
14315  __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 575, __pyx_L1_error)
14316  __Pyx_GOTREF(__pyx_t_3);
14317  __pyx_t_5 = (__pyx_v_self->view.suboffsets + __pyx_v_self->view.ndim);
14318  for (__pyx_t_6 = __pyx_v_self->view.suboffsets; __pyx_t_6 < __pyx_t_5; __pyx_t_6++) {
14319  __pyx_t_4 = __pyx_t_6;
14320  __pyx_v_suboffset = (__pyx_t_4[0]);
14321  __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_suboffset); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 575, __pyx_L1_error)
14322  __Pyx_GOTREF(__pyx_t_2);
14323  if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_2))) __PYX_ERR(2, 575, __pyx_L1_error)
14324  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14325  }
14326  __pyx_t_2 = PyList_AsTuple(((PyObject*)__pyx_t_3)); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 575, __pyx_L1_error)
14327  __Pyx_GOTREF(__pyx_t_2);
14328  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14329  __pyx_r = __pyx_t_2;
14330  __pyx_t_2 = 0;
14331  goto __pyx_L0;
14332 
14333  /* "View.MemoryView":571
14334  *
14335  * @property
14336  * def suboffsets(self): # <<<<<<<<<<<<<<
14337  * if self.view.suboffsets == NULL:
14338  * return (-1,) * self.view.ndim
14339  */
14340 
14341  /* function exit code */
14342  __pyx_L1_error:;
14343  __Pyx_XDECREF(__pyx_t_2);
14344  __Pyx_XDECREF(__pyx_t_3);
14345  __Pyx_AddTraceback("View.MemoryView.memoryview.suboffsets.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
14346  __pyx_r = NULL;
14347  __pyx_L0:;
14348  __Pyx_XGIVEREF(__pyx_r);
14349  __Pyx_RefNannyFinishContext();
14350  return __pyx_r;
14351 }
14352 
14353 /* "View.MemoryView":578
14354  *
14355  * @property
14356  * def ndim(self): # <<<<<<<<<<<<<<
14357  * return self.view.ndim
14358  *
14359  */
14360 
14361 /* Python wrapper */
14362 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4ndim_1__get__(PyObject *__pyx_v_self); /*proto*/
14363 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4ndim_1__get__(PyObject *__pyx_v_self) {
14364  PyObject *__pyx_r = 0;
14365  __Pyx_RefNannyDeclarations
14366  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
14367  __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
14368 
14369  /* function exit code */
14370  __Pyx_RefNannyFinishContext();
14371  return __pyx_r;
14372 }
14373 
14374 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
14375  PyObject *__pyx_r = NULL;
14376  __Pyx_RefNannyDeclarations
14377  PyObject *__pyx_t_1 = NULL;
14378  __Pyx_RefNannySetupContext("__get__", 0);
14379 
14380  /* "View.MemoryView":579
14381  * @property
14382  * def ndim(self):
14383  * return self.view.ndim # <<<<<<<<<<<<<<
14384  *
14385  * @property
14386  */
14387  __Pyx_XDECREF(__pyx_r);
14388  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->view.ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 579, __pyx_L1_error)
14389  __Pyx_GOTREF(__pyx_t_1);
14390  __pyx_r = __pyx_t_1;
14391  __pyx_t_1 = 0;
14392  goto __pyx_L0;
14393 
14394  /* "View.MemoryView":578
14395  *
14396  * @property
14397  * def ndim(self): # <<<<<<<<<<<<<<
14398  * return self.view.ndim
14399  *
14400  */
14401 
14402  /* function exit code */
14403  __pyx_L1_error:;
14404  __Pyx_XDECREF(__pyx_t_1);
14405  __Pyx_AddTraceback("View.MemoryView.memoryview.ndim.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
14406  __pyx_r = NULL;
14407  __pyx_L0:;
14408  __Pyx_XGIVEREF(__pyx_r);
14409  __Pyx_RefNannyFinishContext();
14410  return __pyx_r;
14411 }
14412 
14413 /* "View.MemoryView":582
14414  *
14415  * @property
14416  * def itemsize(self): # <<<<<<<<<<<<<<
14417  * return self.view.itemsize
14418  *
14419  */
14420 
14421 /* Python wrapper */
14422 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_8itemsize_1__get__(PyObject *__pyx_v_self); /*proto*/
14423 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_8itemsize_1__get__(PyObject *__pyx_v_self) {
14424  PyObject *__pyx_r = 0;
14425  __Pyx_RefNannyDeclarations
14426  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
14427  __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
14428 
14429  /* function exit code */
14430  __Pyx_RefNannyFinishContext();
14431  return __pyx_r;
14432 }
14433 
14434 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
14435  PyObject *__pyx_r = NULL;
14436  __Pyx_RefNannyDeclarations
14437  PyObject *__pyx_t_1 = NULL;
14438  __Pyx_RefNannySetupContext("__get__", 0);
14439 
14440  /* "View.MemoryView":583
14441  * @property
14442  * def itemsize(self):
14443  * return self.view.itemsize # <<<<<<<<<<<<<<
14444  *
14445  * @property
14446  */
14447  __Pyx_XDECREF(__pyx_r);
14448  __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_self->view.itemsize); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 583, __pyx_L1_error)
14449  __Pyx_GOTREF(__pyx_t_1);
14450  __pyx_r = __pyx_t_1;
14451  __pyx_t_1 = 0;
14452  goto __pyx_L0;
14453 
14454  /* "View.MemoryView":582
14455  *
14456  * @property
14457  * def itemsize(self): # <<<<<<<<<<<<<<
14458  * return self.view.itemsize
14459  *
14460  */
14461 
14462  /* function exit code */
14463  __pyx_L1_error:;
14464  __Pyx_XDECREF(__pyx_t_1);
14465  __Pyx_AddTraceback("View.MemoryView.memoryview.itemsize.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
14466  __pyx_r = NULL;
14467  __pyx_L0:;
14468  __Pyx_XGIVEREF(__pyx_r);
14469  __Pyx_RefNannyFinishContext();
14470  return __pyx_r;
14471 }
14472 
14473 /* "View.MemoryView":586
14474  *
14475  * @property
14476  * def nbytes(self): # <<<<<<<<<<<<<<
14477  * return self.size * self.view.itemsize
14478  *
14479  */
14480 
14481 /* Python wrapper */
14482 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_6nbytes_1__get__(PyObject *__pyx_v_self); /*proto*/
14483 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_6nbytes_1__get__(PyObject *__pyx_v_self) {
14484  PyObject *__pyx_r = 0;
14485  __Pyx_RefNannyDeclarations
14486  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
14487  __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
14488 
14489  /* function exit code */
14490  __Pyx_RefNannyFinishContext();
14491  return __pyx_r;
14492 }
14493 
14494 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
14495  PyObject *__pyx_r = NULL;
14496  __Pyx_RefNannyDeclarations
14497  PyObject *__pyx_t_1 = NULL;
14498  PyObject *__pyx_t_2 = NULL;
14499  PyObject *__pyx_t_3 = NULL;
14500  __Pyx_RefNannySetupContext("__get__", 0);
14501 
14502  /* "View.MemoryView":587
14503  * @property
14504  * def nbytes(self):
14505  * return self.size * self.view.itemsize # <<<<<<<<<<<<<<
14506  *
14507  * @property
14508  */
14509  __Pyx_XDECREF(__pyx_r);
14510  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 587, __pyx_L1_error)
14511  __Pyx_GOTREF(__pyx_t_1);
14512  __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_self->view.itemsize); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 587, __pyx_L1_error)
14513  __Pyx_GOTREF(__pyx_t_2);
14514  __pyx_t_3 = PyNumber_Multiply(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 587, __pyx_L1_error)
14515  __Pyx_GOTREF(__pyx_t_3);
14516  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14517  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14518  __pyx_r = __pyx_t_3;
14519  __pyx_t_3 = 0;
14520  goto __pyx_L0;
14521 
14522  /* "View.MemoryView":586
14523  *
14524  * @property
14525  * def nbytes(self): # <<<<<<<<<<<<<<
14526  * return self.size * self.view.itemsize
14527  *
14528  */
14529 
14530  /* function exit code */
14531  __pyx_L1_error:;
14532  __Pyx_XDECREF(__pyx_t_1);
14533  __Pyx_XDECREF(__pyx_t_2);
14534  __Pyx_XDECREF(__pyx_t_3);
14535  __Pyx_AddTraceback("View.MemoryView.memoryview.nbytes.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
14536  __pyx_r = NULL;
14537  __pyx_L0:;
14538  __Pyx_XGIVEREF(__pyx_r);
14539  __Pyx_RefNannyFinishContext();
14540  return __pyx_r;
14541 }
14542 
14543 /* "View.MemoryView":590
14544  *
14545  * @property
14546  * def size(self): # <<<<<<<<<<<<<<
14547  * if self._size is None:
14548  * result = 1
14549  */
14550 
14551 /* Python wrapper */
14552 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4size_1__get__(PyObject *__pyx_v_self); /*proto*/
14553 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4size_1__get__(PyObject *__pyx_v_self) {
14554  PyObject *__pyx_r = 0;
14555  __Pyx_RefNannyDeclarations
14556  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
14557  __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
14558 
14559  /* function exit code */
14560  __Pyx_RefNannyFinishContext();
14561  return __pyx_r;
14562 }
14563 
14564 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
14565  PyObject *__pyx_v_result = NULL;
14566  PyObject *__pyx_v_length = NULL;
14567  PyObject *__pyx_r = NULL;
14568  __Pyx_RefNannyDeclarations
14569  int __pyx_t_1;
14570  int __pyx_t_2;
14571  Py_ssize_t *__pyx_t_3;
14572  Py_ssize_t *__pyx_t_4;
14573  Py_ssize_t *__pyx_t_5;
14574  PyObject *__pyx_t_6 = NULL;
14575  __Pyx_RefNannySetupContext("__get__", 0);
14576 
14577  /* "View.MemoryView":591
14578  * @property
14579  * def size(self):
14580  * if self._size is None: # <<<<<<<<<<<<<<
14581  * result = 1
14582  *
14583  */
14584  __pyx_t_1 = (__pyx_v_self->_size == Py_None);
14585  __pyx_t_2 = (__pyx_t_1 != 0);
14586  if (__pyx_t_2) {
14587 
14588  /* "View.MemoryView":592
14589  * def size(self):
14590  * if self._size is None:
14591  * result = 1 # <<<<<<<<<<<<<<
14592  *
14593  * for length in self.view.shape[:self.view.ndim]:
14594  */
14595  __Pyx_INCREF(__pyx_int_1);
14596  __pyx_v_result = __pyx_int_1;
14597 
14598  /* "View.MemoryView":594
14599  * result = 1
14600  *
14601  * for length in self.view.shape[:self.view.ndim]: # <<<<<<<<<<<<<<
14602  * result *= length
14603  *
14604  */
14605  __pyx_t_4 = (__pyx_v_self->view.shape + __pyx_v_self->view.ndim);
14606  for (__pyx_t_5 = __pyx_v_self->view.shape; __pyx_t_5 < __pyx_t_4; __pyx_t_5++) {
14607  __pyx_t_3 = __pyx_t_5;
14608  __pyx_t_6 = PyInt_FromSsize_t((__pyx_t_3[0])); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 594, __pyx_L1_error)
14609  __Pyx_GOTREF(__pyx_t_6);
14610  __Pyx_XDECREF_SET(__pyx_v_length, __pyx_t_6);
14611  __pyx_t_6 = 0;
14612 
14613  /* "View.MemoryView":595
14614  *
14615  * for length in self.view.shape[:self.view.ndim]:
14616  * result *= length # <<<<<<<<<<<<<<
14617  *
14618  * self._size = result
14619  */
14620  __pyx_t_6 = PyNumber_InPlaceMultiply(__pyx_v_result, __pyx_v_length); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 595, __pyx_L1_error)
14621  __Pyx_GOTREF(__pyx_t_6);
14622  __Pyx_DECREF_SET(__pyx_v_result, __pyx_t_6);
14623  __pyx_t_6 = 0;
14624  }
14625 
14626  /* "View.MemoryView":597
14627  * result *= length
14628  *
14629  * self._size = result # <<<<<<<<<<<<<<
14630  *
14631  * return self._size
14632  */
14633  __Pyx_INCREF(__pyx_v_result);
14634  __Pyx_GIVEREF(__pyx_v_result);
14635  __Pyx_GOTREF(__pyx_v_self->_size);
14636  __Pyx_DECREF(__pyx_v_self->_size);
14637  __pyx_v_self->_size = __pyx_v_result;
14638 
14639  /* "View.MemoryView":591
14640  * @property
14641  * def size(self):
14642  * if self._size is None: # <<<<<<<<<<<<<<
14643  * result = 1
14644  *
14645  */
14646  }
14647 
14648  /* "View.MemoryView":599
14649  * self._size = result
14650  *
14651  * return self._size # <<<<<<<<<<<<<<
14652  *
14653  * def __len__(self):
14654  */
14655  __Pyx_XDECREF(__pyx_r);
14656  __Pyx_INCREF(__pyx_v_self->_size);
14657  __pyx_r = __pyx_v_self->_size;
14658  goto __pyx_L0;
14659 
14660  /* "View.MemoryView":590
14661  *
14662  * @property
14663  * def size(self): # <<<<<<<<<<<<<<
14664  * if self._size is None:
14665  * result = 1
14666  */
14667 
14668  /* function exit code */
14669  __pyx_L1_error:;
14670  __Pyx_XDECREF(__pyx_t_6);
14671  __Pyx_AddTraceback("View.MemoryView.memoryview.size.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
14672  __pyx_r = NULL;
14673  __pyx_L0:;
14674  __Pyx_XDECREF(__pyx_v_result);
14675  __Pyx_XDECREF(__pyx_v_length);
14676  __Pyx_XGIVEREF(__pyx_r);
14677  __Pyx_RefNannyFinishContext();
14678  return __pyx_r;
14679 }
14680 
14681 /* "View.MemoryView":601
14682  * return self._size
14683  *
14684  * def __len__(self): # <<<<<<<<<<<<<<
14685  * if self.view.ndim >= 1:
14686  * return self.view.shape[0]
14687  */
14688 
14689 /* Python wrapper */
14690 static Py_ssize_t __pyx_memoryview___len__(PyObject *__pyx_v_self); /*proto*/
14691 static Py_ssize_t __pyx_memoryview___len__(PyObject *__pyx_v_self) {
14692  Py_ssize_t __pyx_r;
14693  __Pyx_RefNannyDeclarations
14694  __Pyx_RefNannySetupContext("__len__ (wrapper)", 0);
14695  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_10__len__(((struct __pyx_memoryview_obj *)__pyx_v_self));
14696 
14697  /* function exit code */
14698  __Pyx_RefNannyFinishContext();
14699  return __pyx_r;
14700 }
14701 
14702 static Py_ssize_t __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_10__len__(struct __pyx_memoryview_obj *__pyx_v_self) {
14703  Py_ssize_t __pyx_r;
14704  __Pyx_RefNannyDeclarations
14705  int __pyx_t_1;
14706  __Pyx_RefNannySetupContext("__len__", 0);
14707 
14708  /* "View.MemoryView":602
14709  *
14710  * def __len__(self):
14711  * if self.view.ndim >= 1: # <<<<<<<<<<<<<<
14712  * return self.view.shape[0]
14713  *
14714  */
14715  __pyx_t_1 = ((__pyx_v_self->view.ndim >= 1) != 0);
14716  if (__pyx_t_1) {
14717 
14718  /* "View.MemoryView":603
14719  * def __len__(self):
14720  * if self.view.ndim >= 1:
14721  * return self.view.shape[0] # <<<<<<<<<<<<<<
14722  *
14723  * return 0
14724  */
14725  __pyx_r = (__pyx_v_self->view.shape[0]);
14726  goto __pyx_L0;
14727 
14728  /* "View.MemoryView":602
14729  *
14730  * def __len__(self):
14731  * if self.view.ndim >= 1: # <<<<<<<<<<<<<<
14732  * return self.view.shape[0]
14733  *
14734  */
14735  }
14736 
14737  /* "View.MemoryView":605
14738  * return self.view.shape[0]
14739  *
14740  * return 0 # <<<<<<<<<<<<<<
14741  *
14742  * def __repr__(self):
14743  */
14744  __pyx_r = 0;
14745  goto __pyx_L0;
14746 
14747  /* "View.MemoryView":601
14748  * return self._size
14749  *
14750  * def __len__(self): # <<<<<<<<<<<<<<
14751  * if self.view.ndim >= 1:
14752  * return self.view.shape[0]
14753  */
14754 
14755  /* function exit code */
14756  __pyx_L0:;
14757  __Pyx_RefNannyFinishContext();
14758  return __pyx_r;
14759 }
14760 
14761 /* "View.MemoryView":607
14762  * return 0
14763  *
14764  * def __repr__(self): # <<<<<<<<<<<<<<
14765  * return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__,
14766  * id(self))
14767  */
14768 
14769 /* Python wrapper */
14770 static PyObject *__pyx_memoryview___repr__(PyObject *__pyx_v_self); /*proto*/
14771 static PyObject *__pyx_memoryview___repr__(PyObject *__pyx_v_self) {
14772  PyObject *__pyx_r = 0;
14773  __Pyx_RefNannyDeclarations
14774  __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
14775  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12__repr__(((struct __pyx_memoryview_obj *)__pyx_v_self));
14776 
14777  /* function exit code */
14778  __Pyx_RefNannyFinishContext();
14779  return __pyx_r;
14780 }
14781 
14782 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12__repr__(struct __pyx_memoryview_obj *__pyx_v_self) {
14783  PyObject *__pyx_r = NULL;
14784  __Pyx_RefNannyDeclarations
14785  PyObject *__pyx_t_1 = NULL;
14786  PyObject *__pyx_t_2 = NULL;
14787  PyObject *__pyx_t_3 = NULL;
14788  __Pyx_RefNannySetupContext("__repr__", 0);
14789 
14790  /* "View.MemoryView":608
14791  *
14792  * def __repr__(self):
14793  * return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__, # <<<<<<<<<<<<<<
14794  * id(self))
14795  *
14796  */
14797  __Pyx_XDECREF(__pyx_r);
14798  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_base); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 608, __pyx_L1_error)
14799  __Pyx_GOTREF(__pyx_t_1);
14800  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 608, __pyx_L1_error)
14801  __Pyx_GOTREF(__pyx_t_2);
14802  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14803  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_name_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 608, __pyx_L1_error)
14804  __Pyx_GOTREF(__pyx_t_1);
14805  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14806 
14807  /* "View.MemoryView":609
14808  * def __repr__(self):
14809  * return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__,
14810  * id(self)) # <<<<<<<<<<<<<<
14811  *
14812  * def __str__(self):
14813  */
14814  __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_id, ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 609, __pyx_L1_error)
14815  __Pyx_GOTREF(__pyx_t_2);
14816 
14817  /* "View.MemoryView":608
14818  *
14819  * def __repr__(self):
14820  * return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__, # <<<<<<<<<<<<<<
14821  * id(self))
14822  *
14823  */
14824  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 608, __pyx_L1_error)
14825  __Pyx_GOTREF(__pyx_t_3);
14826  __Pyx_GIVEREF(__pyx_t_1);
14827  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
14828  __Pyx_GIVEREF(__pyx_t_2);
14829  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
14830  __pyx_t_1 = 0;
14831  __pyx_t_2 = 0;
14832  __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_MemoryView_of_r_at_0x_x, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 608, __pyx_L1_error)
14833  __Pyx_GOTREF(__pyx_t_2);
14834  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14835  __pyx_r = __pyx_t_2;
14836  __pyx_t_2 = 0;
14837  goto __pyx_L0;
14838 
14839  /* "View.MemoryView":607
14840  * return 0
14841  *
14842  * def __repr__(self): # <<<<<<<<<<<<<<
14843  * return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__,
14844  * id(self))
14845  */
14846 
14847  /* function exit code */
14848  __pyx_L1_error:;
14849  __Pyx_XDECREF(__pyx_t_1);
14850  __Pyx_XDECREF(__pyx_t_2);
14851  __Pyx_XDECREF(__pyx_t_3);
14852  __Pyx_AddTraceback("View.MemoryView.memoryview.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
14853  __pyx_r = NULL;
14854  __pyx_L0:;
14855  __Pyx_XGIVEREF(__pyx_r);
14856  __Pyx_RefNannyFinishContext();
14857  return __pyx_r;
14858 }
14859 
14860 /* "View.MemoryView":611
14861  * id(self))
14862  *
14863  * def __str__(self): # <<<<<<<<<<<<<<
14864  * return "<MemoryView of %r object>" % (self.base.__class__.__name__,)
14865  *
14866  */
14867 
14868 /* Python wrapper */
14869 static PyObject *__pyx_memoryview___str__(PyObject *__pyx_v_self); /*proto*/
14870 static PyObject *__pyx_memoryview___str__(PyObject *__pyx_v_self) {
14871  PyObject *__pyx_r = 0;
14872  __Pyx_RefNannyDeclarations
14873  __Pyx_RefNannySetupContext("__str__ (wrapper)", 0);
14874  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14__str__(((struct __pyx_memoryview_obj *)__pyx_v_self));
14875 
14876  /* function exit code */
14877  __Pyx_RefNannyFinishContext();
14878  return __pyx_r;
14879 }
14880 
14881 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14__str__(struct __pyx_memoryview_obj *__pyx_v_self) {
14882  PyObject *__pyx_r = NULL;
14883  __Pyx_RefNannyDeclarations
14884  PyObject *__pyx_t_1 = NULL;
14885  PyObject *__pyx_t_2 = NULL;
14886  __Pyx_RefNannySetupContext("__str__", 0);
14887 
14888  /* "View.MemoryView":612
14889  *
14890  * def __str__(self):
14891  * return "<MemoryView of %r object>" % (self.base.__class__.__name__,) # <<<<<<<<<<<<<<
14892  *
14893  *
14894  */
14895  __Pyx_XDECREF(__pyx_r);
14896  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_base); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 612, __pyx_L1_error)
14897  __Pyx_GOTREF(__pyx_t_1);
14898  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 612, __pyx_L1_error)
14899  __Pyx_GOTREF(__pyx_t_2);
14900  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14901  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_name_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 612, __pyx_L1_error)
14902  __Pyx_GOTREF(__pyx_t_1);
14903  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14904  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 612, __pyx_L1_error)
14905  __Pyx_GOTREF(__pyx_t_2);
14906  __Pyx_GIVEREF(__pyx_t_1);
14907  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
14908  __pyx_t_1 = 0;
14909  __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_MemoryView_of_r_object, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 612, __pyx_L1_error)
14910  __Pyx_GOTREF(__pyx_t_1);
14911  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14912  __pyx_r = __pyx_t_1;
14913  __pyx_t_1 = 0;
14914  goto __pyx_L0;
14915 
14916  /* "View.MemoryView":611
14917  * id(self))
14918  *
14919  * def __str__(self): # <<<<<<<<<<<<<<
14920  * return "<MemoryView of %r object>" % (self.base.__class__.__name__,)
14921  *
14922  */
14923 
14924  /* function exit code */
14925  __pyx_L1_error:;
14926  __Pyx_XDECREF(__pyx_t_1);
14927  __Pyx_XDECREF(__pyx_t_2);
14928  __Pyx_AddTraceback("View.MemoryView.memoryview.__str__", __pyx_clineno, __pyx_lineno, __pyx_filename);
14929  __pyx_r = NULL;
14930  __pyx_L0:;
14931  __Pyx_XGIVEREF(__pyx_r);
14932  __Pyx_RefNannyFinishContext();
14933  return __pyx_r;
14934 }
14935 
14936 /* "View.MemoryView":615
14937  *
14938  *
14939  * def is_c_contig(self): # <<<<<<<<<<<<<<
14940  * cdef __Pyx_memviewslice *mslice
14941  * cdef __Pyx_memviewslice tmp
14942  */
14943 
14944 /* Python wrapper */
14945 static PyObject *__pyx_memoryview_is_c_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
14946 static PyObject *__pyx_memoryview_is_c_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
14947  PyObject *__pyx_r = 0;
14948  __Pyx_RefNannyDeclarations
14949  __Pyx_RefNannySetupContext("is_c_contig (wrapper)", 0);
14950  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16is_c_contig(((struct __pyx_memoryview_obj *)__pyx_v_self));
14951 
14952  /* function exit code */
14953  __Pyx_RefNannyFinishContext();
14954  return __pyx_r;
14955 }
14956 
14957 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16is_c_contig(struct __pyx_memoryview_obj *__pyx_v_self) {
14958  __Pyx_memviewslice *__pyx_v_mslice;
14959  __Pyx_memviewslice __pyx_v_tmp;
14960  PyObject *__pyx_r = NULL;
14961  __Pyx_RefNannyDeclarations
14962  PyObject *__pyx_t_1 = NULL;
14963  __Pyx_RefNannySetupContext("is_c_contig", 0);
14964 
14965  /* "View.MemoryView":618
14966  * cdef __Pyx_memviewslice *mslice
14967  * cdef __Pyx_memviewslice tmp
14968  * mslice = get_slice_from_memview(self, &tmp) # <<<<<<<<<<<<<<
14969  * return slice_is_contig(mslice[0], 'C', self.view.ndim)
14970  *
14971  */
14972  __pyx_v_mslice = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_self, (&__pyx_v_tmp));
14973 
14974  /* "View.MemoryView":619
14975  * cdef __Pyx_memviewslice tmp
14976  * mslice = get_slice_from_memview(self, &tmp)
14977  * return slice_is_contig(mslice[0], 'C', self.view.ndim) # <<<<<<<<<<<<<<
14978  *
14979  * def is_f_contig(self):
14980  */
14981  __Pyx_XDECREF(__pyx_r);
14982  __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_memviewslice_is_contig((__pyx_v_mslice[0]), 'C', __pyx_v_self->view.ndim)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 619, __pyx_L1_error)
14983  __Pyx_GOTREF(__pyx_t_1);
14984  __pyx_r = __pyx_t_1;
14985  __pyx_t_1 = 0;
14986  goto __pyx_L0;
14987 
14988  /* "View.MemoryView":615
14989  *
14990  *
14991  * def is_c_contig(self): # <<<<<<<<<<<<<<
14992  * cdef __Pyx_memviewslice *mslice
14993  * cdef __Pyx_memviewslice tmp
14994  */
14995 
14996  /* function exit code */
14997  __pyx_L1_error:;
14998  __Pyx_XDECREF(__pyx_t_1);
14999  __Pyx_AddTraceback("View.MemoryView.memoryview.is_c_contig", __pyx_clineno, __pyx_lineno, __pyx_filename);
15000  __pyx_r = NULL;
15001  __pyx_L0:;
15002  __Pyx_XGIVEREF(__pyx_r);
15003  __Pyx_RefNannyFinishContext();
15004  return __pyx_r;
15005 }
15006 
15007 /* "View.MemoryView":621
15008  * return slice_is_contig(mslice[0], 'C', self.view.ndim)
15009  *
15010  * def is_f_contig(self): # <<<<<<<<<<<<<<
15011  * cdef __Pyx_memviewslice *mslice
15012  * cdef __Pyx_memviewslice tmp
15013  */
15014 
15015 /* Python wrapper */
15016 static PyObject *__pyx_memoryview_is_f_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
15017 static PyObject *__pyx_memoryview_is_f_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
15018  PyObject *__pyx_r = 0;
15019  __Pyx_RefNannyDeclarations
15020  __Pyx_RefNannySetupContext("is_f_contig (wrapper)", 0);
15021  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18is_f_contig(((struct __pyx_memoryview_obj *)__pyx_v_self));
15022 
15023  /* function exit code */
15024  __Pyx_RefNannyFinishContext();
15025  return __pyx_r;
15026 }
15027 
15028 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18is_f_contig(struct __pyx_memoryview_obj *__pyx_v_self) {
15029  __Pyx_memviewslice *__pyx_v_mslice;
15030  __Pyx_memviewslice __pyx_v_tmp;
15031  PyObject *__pyx_r = NULL;
15032  __Pyx_RefNannyDeclarations
15033  PyObject *__pyx_t_1 = NULL;
15034  __Pyx_RefNannySetupContext("is_f_contig", 0);
15035 
15036  /* "View.MemoryView":624
15037  * cdef __Pyx_memviewslice *mslice
15038  * cdef __Pyx_memviewslice tmp
15039  * mslice = get_slice_from_memview(self, &tmp) # <<<<<<<<<<<<<<
15040  * return slice_is_contig(mslice[0], 'F', self.view.ndim)
15041  *
15042  */
15043  __pyx_v_mslice = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_self, (&__pyx_v_tmp));
15044 
15045  /* "View.MemoryView":625
15046  * cdef __Pyx_memviewslice tmp
15047  * mslice = get_slice_from_memview(self, &tmp)
15048  * return slice_is_contig(mslice[0], 'F', self.view.ndim) # <<<<<<<<<<<<<<
15049  *
15050  * def copy(self):
15051  */
15052  __Pyx_XDECREF(__pyx_r);
15053  __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_memviewslice_is_contig((__pyx_v_mslice[0]), 'F', __pyx_v_self->view.ndim)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 625, __pyx_L1_error)
15054  __Pyx_GOTREF(__pyx_t_1);
15055  __pyx_r = __pyx_t_1;
15056  __pyx_t_1 = 0;
15057  goto __pyx_L0;
15058 
15059  /* "View.MemoryView":621
15060  * return slice_is_contig(mslice[0], 'C', self.view.ndim)
15061  *
15062  * def is_f_contig(self): # <<<<<<<<<<<<<<
15063  * cdef __Pyx_memviewslice *mslice
15064  * cdef __Pyx_memviewslice tmp
15065  */
15066 
15067  /* function exit code */
15068  __pyx_L1_error:;
15069  __Pyx_XDECREF(__pyx_t_1);
15070  __Pyx_AddTraceback("View.MemoryView.memoryview.is_f_contig", __pyx_clineno, __pyx_lineno, __pyx_filename);
15071  __pyx_r = NULL;
15072  __pyx_L0:;
15073  __Pyx_XGIVEREF(__pyx_r);
15074  __Pyx_RefNannyFinishContext();
15075  return __pyx_r;
15076 }
15077 
15078 /* "View.MemoryView":627
15079  * return slice_is_contig(mslice[0], 'F', self.view.ndim)
15080  *
15081  * def copy(self): # <<<<<<<<<<<<<<
15082  * cdef __Pyx_memviewslice mslice
15083  * cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS
15084  */
15085 
15086 /* Python wrapper */
15087 static PyObject *__pyx_memoryview_copy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
15088 static PyObject *__pyx_memoryview_copy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
15089  PyObject *__pyx_r = 0;
15090  __Pyx_RefNannyDeclarations
15091  __Pyx_RefNannySetupContext("copy (wrapper)", 0);
15092  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20copy(((struct __pyx_memoryview_obj *)__pyx_v_self));
15093 
15094  /* function exit code */
15095  __Pyx_RefNannyFinishContext();
15096  return __pyx_r;
15097 }
15098 
15099 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20copy(struct __pyx_memoryview_obj *__pyx_v_self) {
15100  __Pyx_memviewslice __pyx_v_mslice;
15101  int __pyx_v_flags;
15102  PyObject *__pyx_r = NULL;
15103  __Pyx_RefNannyDeclarations
15104  __Pyx_memviewslice __pyx_t_1;
15105  PyObject *__pyx_t_2 = NULL;
15106  __Pyx_RefNannySetupContext("copy", 0);
15107 
15108  /* "View.MemoryView":629
15109  * def copy(self):
15110  * cdef __Pyx_memviewslice mslice
15111  * cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS # <<<<<<<<<<<<<<
15112  *
15113  * slice_copy(self, &mslice)
15114  */
15115  __pyx_v_flags = (__pyx_v_self->flags & (~PyBUF_F_CONTIGUOUS));
15116 
15117  /* "View.MemoryView":631
15118  * cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS
15119  *
15120  * slice_copy(self, &mslice) # <<<<<<<<<<<<<<
15121  * mslice = slice_copy_contig(&mslice, "c", self.view.ndim,
15122  * self.view.itemsize,
15123  */
15124  __pyx_memoryview_slice_copy(__pyx_v_self, (&__pyx_v_mslice));
15125 
15126  /* "View.MemoryView":632
15127  *
15128  * slice_copy(self, &mslice)
15129  * mslice = slice_copy_contig(&mslice, "c", self.view.ndim, # <<<<<<<<<<<<<<
15130  * self.view.itemsize,
15131  * flags|PyBUF_C_CONTIGUOUS,
15132  */
15133  __pyx_t_1 = __pyx_memoryview_copy_new_contig((&__pyx_v_mslice), ((char *)"c"), __pyx_v_self->view.ndim, __pyx_v_self->view.itemsize, (__pyx_v_flags | PyBUF_C_CONTIGUOUS), __pyx_v_self->dtype_is_object); if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 632, __pyx_L1_error)
15134  __pyx_v_mslice = __pyx_t_1;
15135 
15136  /* "View.MemoryView":637
15137  * self.dtype_is_object)
15138  *
15139  * return memoryview_copy_from_slice(self, &mslice) # <<<<<<<<<<<<<<
15140  *
15141  * def copy_fortran(self):
15142  */
15143  __Pyx_XDECREF(__pyx_r);
15144  __pyx_t_2 = __pyx_memoryview_copy_object_from_slice(__pyx_v_self, (&__pyx_v_mslice)); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 637, __pyx_L1_error)
15145  __Pyx_GOTREF(__pyx_t_2);
15146  __pyx_r = __pyx_t_2;
15147  __pyx_t_2 = 0;
15148  goto __pyx_L0;
15149 
15150  /* "View.MemoryView":627
15151  * return slice_is_contig(mslice[0], 'F', self.view.ndim)
15152  *
15153  * def copy(self): # <<<<<<<<<<<<<<
15154  * cdef __Pyx_memviewslice mslice
15155  * cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS
15156  */
15157 
15158  /* function exit code */
15159  __pyx_L1_error:;
15160  __Pyx_XDECREF(__pyx_t_2);
15161  __Pyx_AddTraceback("View.MemoryView.memoryview.copy", __pyx_clineno, __pyx_lineno, __pyx_filename);
15162  __pyx_r = NULL;
15163  __pyx_L0:;
15164  __Pyx_XGIVEREF(__pyx_r);
15165  __Pyx_RefNannyFinishContext();
15166  return __pyx_r;
15167 }
15168 
15169 /* "View.MemoryView":639
15170  * return memoryview_copy_from_slice(self, &mslice)
15171  *
15172  * def copy_fortran(self): # <<<<<<<<<<<<<<
15173  * cdef __Pyx_memviewslice src, dst
15174  * cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS
15175  */
15176 
15177 /* Python wrapper */
15178 static PyObject *__pyx_memoryview_copy_fortran(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
15179 static PyObject *__pyx_memoryview_copy_fortran(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
15180  PyObject *__pyx_r = 0;
15181  __Pyx_RefNannyDeclarations
15182  __Pyx_RefNannySetupContext("copy_fortran (wrapper)", 0);
15183  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22copy_fortran(((struct __pyx_memoryview_obj *)__pyx_v_self));
15184 
15185  /* function exit code */
15186  __Pyx_RefNannyFinishContext();
15187  return __pyx_r;
15188 }
15189 
15190 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22copy_fortran(struct __pyx_memoryview_obj *__pyx_v_self) {
15191  __Pyx_memviewslice __pyx_v_src;
15192  __Pyx_memviewslice __pyx_v_dst;
15193  int __pyx_v_flags;
15194  PyObject *__pyx_r = NULL;
15195  __Pyx_RefNannyDeclarations
15196  __Pyx_memviewslice __pyx_t_1;
15197  PyObject *__pyx_t_2 = NULL;
15198  __Pyx_RefNannySetupContext("copy_fortran", 0);
15199 
15200  /* "View.MemoryView":641
15201  * def copy_fortran(self):
15202  * cdef __Pyx_memviewslice src, dst
15203  * cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS # <<<<<<<<<<<<<<
15204  *
15205  * slice_copy(self, &src)
15206  */
15207  __pyx_v_flags = (__pyx_v_self->flags & (~PyBUF_C_CONTIGUOUS));
15208 
15209  /* "View.MemoryView":643
15210  * cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS
15211  *
15212  * slice_copy(self, &src) # <<<<<<<<<<<<<<
15213  * dst = slice_copy_contig(&src, "fortran", self.view.ndim,
15214  * self.view.itemsize,
15215  */
15216  __pyx_memoryview_slice_copy(__pyx_v_self, (&__pyx_v_src));
15217 
15218  /* "View.MemoryView":644
15219  *
15220  * slice_copy(self, &src)
15221  * dst = slice_copy_contig(&src, "fortran", self.view.ndim, # <<<<<<<<<<<<<<
15222  * self.view.itemsize,
15223  * flags|PyBUF_F_CONTIGUOUS,
15224  */
15225  __pyx_t_1 = __pyx_memoryview_copy_new_contig((&__pyx_v_src), ((char *)"fortran"), __pyx_v_self->view.ndim, __pyx_v_self->view.itemsize, (__pyx_v_flags | PyBUF_F_CONTIGUOUS), __pyx_v_self->dtype_is_object); if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 644, __pyx_L1_error)
15226  __pyx_v_dst = __pyx_t_1;
15227 
15228  /* "View.MemoryView":649
15229  * self.dtype_is_object)
15230  *
15231  * return memoryview_copy_from_slice(self, &dst) # <<<<<<<<<<<<<<
15232  *
15233  *
15234  */
15235  __Pyx_XDECREF(__pyx_r);
15236  __pyx_t_2 = __pyx_memoryview_copy_object_from_slice(__pyx_v_self, (&__pyx_v_dst)); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 649, __pyx_L1_error)
15237  __Pyx_GOTREF(__pyx_t_2);
15238  __pyx_r = __pyx_t_2;
15239  __pyx_t_2 = 0;
15240  goto __pyx_L0;
15241 
15242  /* "View.MemoryView":639
15243  * return memoryview_copy_from_slice(self, &mslice)
15244  *
15245  * def copy_fortran(self): # <<<<<<<<<<<<<<
15246  * cdef __Pyx_memviewslice src, dst
15247  * cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS
15248  */
15249 
15250  /* function exit code */
15251  __pyx_L1_error:;
15252  __Pyx_XDECREF(__pyx_t_2);
15253  __Pyx_AddTraceback("View.MemoryView.memoryview.copy_fortran", __pyx_clineno, __pyx_lineno, __pyx_filename);
15254  __pyx_r = NULL;
15255  __pyx_L0:;
15256  __Pyx_XGIVEREF(__pyx_r);
15257  __Pyx_RefNannyFinishContext();
15258  return __pyx_r;
15259 }
15260 
15261 /* "(tree fragment)":1
15262  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
15263  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
15264  * def __setstate_cython__(self, __pyx_state):
15265  */
15266 
15267 /* Python wrapper */
15268 static PyObject *__pyx_pw___pyx_memoryview_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
15269 static PyObject *__pyx_pw___pyx_memoryview_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
15270  PyObject *__pyx_r = 0;
15271  __Pyx_RefNannyDeclarations
15272  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
15273  __pyx_r = __pyx_pf___pyx_memoryview___reduce_cython__(((struct __pyx_memoryview_obj *)__pyx_v_self));
15274 
15275  /* function exit code */
15276  __Pyx_RefNannyFinishContext();
15277  return __pyx_r;
15278 }
15279 
15280 static PyObject *__pyx_pf___pyx_memoryview___reduce_cython__(CYTHON_UNUSED struct __pyx_memoryview_obj *__pyx_v_self) {
15281  PyObject *__pyx_r = NULL;
15282  __Pyx_RefNannyDeclarations
15283  PyObject *__pyx_t_1 = NULL;
15284  __Pyx_RefNannySetupContext("__reduce_cython__", 0);
15285 
15286  /* "(tree fragment)":2
15287  * def __reduce_cython__(self):
15288  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
15289  * def __setstate_cython__(self, __pyx_state):
15290  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
15291  */
15292  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__20, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 2, __pyx_L1_error)
15293  __Pyx_GOTREF(__pyx_t_1);
15294  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
15295  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
15296  __PYX_ERR(2, 2, __pyx_L1_error)
15297 
15298  /* "(tree fragment)":1
15299  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
15300  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
15301  * def __setstate_cython__(self, __pyx_state):
15302  */
15303 
15304  /* function exit code */
15305  __pyx_L1_error:;
15306  __Pyx_XDECREF(__pyx_t_1);
15307  __Pyx_AddTraceback("View.MemoryView.memoryview.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
15308  __pyx_r = NULL;
15309  __Pyx_XGIVEREF(__pyx_r);
15310  __Pyx_RefNannyFinishContext();
15311  return __pyx_r;
15312 }
15313 
15314 /* "(tree fragment)":3
15315  * def __reduce_cython__(self):
15316  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
15317  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
15318  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
15319  */
15320 
15321 /* Python wrapper */
15322 static PyObject *__pyx_pw___pyx_memoryview_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
15323 static PyObject *__pyx_pw___pyx_memoryview_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
15324  PyObject *__pyx_r = 0;
15325  __Pyx_RefNannyDeclarations
15326  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
15327  __pyx_r = __pyx_pf___pyx_memoryview_2__setstate_cython__(((struct __pyx_memoryview_obj *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
15328 
15329  /* function exit code */
15330  __Pyx_RefNannyFinishContext();
15331  return __pyx_r;
15332 }
15333 
15334 static PyObject *__pyx_pf___pyx_memoryview_2__setstate_cython__(CYTHON_UNUSED struct __pyx_memoryview_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
15335  PyObject *__pyx_r = NULL;
15336  __Pyx_RefNannyDeclarations
15337  PyObject *__pyx_t_1 = NULL;
15338  __Pyx_RefNannySetupContext("__setstate_cython__", 0);
15339 
15340  /* "(tree fragment)":4
15341  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
15342  * def __setstate_cython__(self, __pyx_state):
15343  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
15344  */
15345  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__21, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 4, __pyx_L1_error)
15346  __Pyx_GOTREF(__pyx_t_1);
15347  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
15348  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
15349  __PYX_ERR(2, 4, __pyx_L1_error)
15350 
15351  /* "(tree fragment)":3
15352  * def __reduce_cython__(self):
15353  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
15354  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
15355  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
15356  */
15357 
15358  /* function exit code */
15359  __pyx_L1_error:;
15360  __Pyx_XDECREF(__pyx_t_1);
15361  __Pyx_AddTraceback("View.MemoryView.memoryview.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
15362  __pyx_r = NULL;
15363  __Pyx_XGIVEREF(__pyx_r);
15364  __Pyx_RefNannyFinishContext();
15365  return __pyx_r;
15366 }
15367 
15368 /* "View.MemoryView":653
15369  *
15370  * @cname('__pyx_memoryview_new')
15371  * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo): # <<<<<<<<<<<<<<
15372  * cdef memoryview result = memoryview(o, flags, dtype_is_object)
15373  * result.typeinfo = typeinfo
15374  */
15375 
15376 static PyObject *__pyx_memoryview_new(PyObject *__pyx_v_o, int __pyx_v_flags, int __pyx_v_dtype_is_object, __Pyx_TypeInfo *__pyx_v_typeinfo) {
15377  struct __pyx_memoryview_obj *__pyx_v_result = 0;
15378  PyObject *__pyx_r = NULL;
15379  __Pyx_RefNannyDeclarations
15380  PyObject *__pyx_t_1 = NULL;
15381  PyObject *__pyx_t_2 = NULL;
15382  PyObject *__pyx_t_3 = NULL;
15383  __Pyx_RefNannySetupContext("memoryview_cwrapper", 0);
15384 
15385  /* "View.MemoryView":654
15386  * @cname('__pyx_memoryview_new')
15387  * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo):
15388  * cdef memoryview result = memoryview(o, flags, dtype_is_object) # <<<<<<<<<<<<<<
15389  * result.typeinfo = typeinfo
15390  * return result
15391  */
15392  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 654, __pyx_L1_error)
15393  __Pyx_GOTREF(__pyx_t_1);
15394  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 654, __pyx_L1_error)
15395  __Pyx_GOTREF(__pyx_t_2);
15396  __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 654, __pyx_L1_error)
15397  __Pyx_GOTREF(__pyx_t_3);
15398  __Pyx_INCREF(__pyx_v_o);
15399  __Pyx_GIVEREF(__pyx_v_o);
15400  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_o);
15401  __Pyx_GIVEREF(__pyx_t_1);
15402  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1);
15403  __Pyx_GIVEREF(__pyx_t_2);
15404  PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2);
15405  __pyx_t_1 = 0;
15406  __pyx_t_2 = 0;
15407  __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 654, __pyx_L1_error)
15408  __Pyx_GOTREF(__pyx_t_2);
15409  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15410  __pyx_v_result = ((struct __pyx_memoryview_obj *)__pyx_t_2);
15411  __pyx_t_2 = 0;
15412 
15413  /* "View.MemoryView":655
15414  * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo):
15415  * cdef memoryview result = memoryview(o, flags, dtype_is_object)
15416  * result.typeinfo = typeinfo # <<<<<<<<<<<<<<
15417  * return result
15418  *
15419  */
15420  __pyx_v_result->typeinfo = __pyx_v_typeinfo;
15421 
15422  /* "View.MemoryView":656
15423  * cdef memoryview result = memoryview(o, flags, dtype_is_object)
15424  * result.typeinfo = typeinfo
15425  * return result # <<<<<<<<<<<<<<
15426  *
15427  * @cname('__pyx_memoryview_check')
15428  */
15429  __Pyx_XDECREF(__pyx_r);
15430  __Pyx_INCREF(((PyObject *)__pyx_v_result));
15431  __pyx_r = ((PyObject *)__pyx_v_result);
15432  goto __pyx_L0;
15433 
15434  /* "View.MemoryView":653
15435  *
15436  * @cname('__pyx_memoryview_new')
15437  * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo): # <<<<<<<<<<<<<<
15438  * cdef memoryview result = memoryview(o, flags, dtype_is_object)
15439  * result.typeinfo = typeinfo
15440  */
15441 
15442  /* function exit code */
15443  __pyx_L1_error:;
15444  __Pyx_XDECREF(__pyx_t_1);
15445  __Pyx_XDECREF(__pyx_t_2);
15446  __Pyx_XDECREF(__pyx_t_3);
15447  __Pyx_AddTraceback("View.MemoryView.memoryview_cwrapper", __pyx_clineno, __pyx_lineno, __pyx_filename);
15448  __pyx_r = 0;
15449  __pyx_L0:;
15450  __Pyx_XDECREF((PyObject *)__pyx_v_result);
15451  __Pyx_XGIVEREF(__pyx_r);
15452  __Pyx_RefNannyFinishContext();
15453  return __pyx_r;
15454 }
15455 
15456 /* "View.MemoryView":659
15457  *
15458  * @cname('__pyx_memoryview_check')
15459  * cdef inline bint memoryview_check(object o): # <<<<<<<<<<<<<<
15460  * return isinstance(o, memoryview)
15461  *
15462  */
15463 
15464 static CYTHON_INLINE int __pyx_memoryview_check(PyObject *__pyx_v_o) {
15465  int __pyx_r;
15466  __Pyx_RefNannyDeclarations
15467  int __pyx_t_1;
15468  __Pyx_RefNannySetupContext("memoryview_check", 0);
15469 
15470  /* "View.MemoryView":660
15471  * @cname('__pyx_memoryview_check')
15472  * cdef inline bint memoryview_check(object o):
15473  * return isinstance(o, memoryview) # <<<<<<<<<<<<<<
15474  *
15475  * cdef tuple _unellipsify(object index, int ndim):
15476  */
15477  __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_o, __pyx_memoryview_type);
15478  __pyx_r = __pyx_t_1;
15479  goto __pyx_L0;
15480 
15481  /* "View.MemoryView":659
15482  *
15483  * @cname('__pyx_memoryview_check')
15484  * cdef inline bint memoryview_check(object o): # <<<<<<<<<<<<<<
15485  * return isinstance(o, memoryview)
15486  *
15487  */
15488 
15489  /* function exit code */
15490  __pyx_L0:;
15491  __Pyx_RefNannyFinishContext();
15492  return __pyx_r;
15493 }
15494 
15495 /* "View.MemoryView":662
15496  * return isinstance(o, memoryview)
15497  *
15498  * cdef tuple _unellipsify(object index, int ndim): # <<<<<<<<<<<<<<
15499  * """
15500  * Replace all ellipses with full slices and fill incomplete indices with
15501  */
15502 
15503 static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) {
15504  PyObject *__pyx_v_tup = NULL;
15505  PyObject *__pyx_v_result = NULL;
15506  int __pyx_v_have_slices;
15507  int __pyx_v_seen_ellipsis;
15508  CYTHON_UNUSED PyObject *__pyx_v_idx = NULL;
15509  PyObject *__pyx_v_item = NULL;
15510  Py_ssize_t __pyx_v_nslices;
15511  PyObject *__pyx_r = NULL;
15512  __Pyx_RefNannyDeclarations
15513  int __pyx_t_1;
15514  int __pyx_t_2;
15515  PyObject *__pyx_t_3 = NULL;
15516  PyObject *__pyx_t_4 = NULL;
15517  Py_ssize_t __pyx_t_5;
15518  PyObject *(*__pyx_t_6)(PyObject *);
15519  PyObject *__pyx_t_7 = NULL;
15520  Py_ssize_t __pyx_t_8;
15521  int __pyx_t_9;
15522  int __pyx_t_10;
15523  PyObject *__pyx_t_11 = NULL;
15524  __Pyx_RefNannySetupContext("_unellipsify", 0);
15525 
15526  /* "View.MemoryView":667
15527  * full slices.
15528  * """
15529  * if not isinstance(index, tuple): # <<<<<<<<<<<<<<
15530  * tup = (index,)
15531  * else:
15532  */
15533  __pyx_t_1 = PyTuple_Check(__pyx_v_index);
15534  __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
15535  if (__pyx_t_2) {
15536 
15537  /* "View.MemoryView":668
15538  * """
15539  * if not isinstance(index, tuple):
15540  * tup = (index,) # <<<<<<<<<<<<<<
15541  * else:
15542  * tup = index
15543  */
15544  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 668, __pyx_L1_error)
15545  __Pyx_GOTREF(__pyx_t_3);
15546  __Pyx_INCREF(__pyx_v_index);
15547  __Pyx_GIVEREF(__pyx_v_index);
15548  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_index);
15549  __pyx_v_tup = __pyx_t_3;
15550  __pyx_t_3 = 0;
15551 
15552  /* "View.MemoryView":667
15553  * full slices.
15554  * """
15555  * if not isinstance(index, tuple): # <<<<<<<<<<<<<<
15556  * tup = (index,)
15557  * else:
15558  */
15559  goto __pyx_L3;
15560  }
15561 
15562  /* "View.MemoryView":670
15563  * tup = (index,)
15564  * else:
15565  * tup = index # <<<<<<<<<<<<<<
15566  *
15567  * result = []
15568  */
15569  /*else*/ {
15570  __Pyx_INCREF(__pyx_v_index);
15571  __pyx_v_tup = __pyx_v_index;
15572  }
15573  __pyx_L3:;
15574 
15575  /* "View.MemoryView":672
15576  * tup = index
15577  *
15578  * result = [] # <<<<<<<<<<<<<<
15579  * have_slices = False
15580  * seen_ellipsis = False
15581  */
15582  __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 672, __pyx_L1_error)
15583  __Pyx_GOTREF(__pyx_t_3);
15584  __pyx_v_result = ((PyObject*)__pyx_t_3);
15585  __pyx_t_3 = 0;
15586 
15587  /* "View.MemoryView":673
15588  *
15589  * result = []
15590  * have_slices = False # <<<<<<<<<<<<<<
15591  * seen_ellipsis = False
15592  * for idx, item in enumerate(tup):
15593  */
15594  __pyx_v_have_slices = 0;
15595 
15596  /* "View.MemoryView":674
15597  * result = []
15598  * have_slices = False
15599  * seen_ellipsis = False # <<<<<<<<<<<<<<
15600  * for idx, item in enumerate(tup):
15601  * if item is Ellipsis:
15602  */
15603  __pyx_v_seen_ellipsis = 0;
15604 
15605  /* "View.MemoryView":675
15606  * have_slices = False
15607  * seen_ellipsis = False
15608  * for idx, item in enumerate(tup): # <<<<<<<<<<<<<<
15609  * if item is Ellipsis:
15610  * if not seen_ellipsis:
15611  */
15612  __Pyx_INCREF(__pyx_int_0);
15613  __pyx_t_3 = __pyx_int_0;
15614  if (likely(PyList_CheckExact(__pyx_v_tup)) || PyTuple_CheckExact(__pyx_v_tup)) {
15615  __pyx_t_4 = __pyx_v_tup; __Pyx_INCREF(__pyx_t_4); __pyx_t_5 = 0;
15616  __pyx_t_6 = NULL;
15617  } else {
15618  __pyx_t_5 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_tup); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 675, __pyx_L1_error)
15619  __Pyx_GOTREF(__pyx_t_4);
15620  __pyx_t_6 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 675, __pyx_L1_error)
15621  }
15622  for (;;) {
15623  if (likely(!__pyx_t_6)) {
15624  if (likely(PyList_CheckExact(__pyx_t_4))) {
15625  if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_4)) break;
15626  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
15627  __pyx_t_7 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(2, 675, __pyx_L1_error)
15628  #else
15629  __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 675, __pyx_L1_error)
15630  __Pyx_GOTREF(__pyx_t_7);
15631  #endif
15632  } else {
15633  if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_4)) break;
15634  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
15635  __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(2, 675, __pyx_L1_error)
15636  #else
15637  __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 675, __pyx_L1_error)
15638  __Pyx_GOTREF(__pyx_t_7);
15639  #endif
15640  }
15641  } else {
15642  __pyx_t_7 = __pyx_t_6(__pyx_t_4);
15643  if (unlikely(!__pyx_t_7)) {
15644  PyObject* exc_type = PyErr_Occurred();
15645  if (exc_type) {
15646  if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
15647  else __PYX_ERR(2, 675, __pyx_L1_error)
15648  }
15649  break;
15650  }
15651  __Pyx_GOTREF(__pyx_t_7);
15652  }
15653  __Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_7);
15654  __pyx_t_7 = 0;
15655  __Pyx_INCREF(__pyx_t_3);
15656  __Pyx_XDECREF_SET(__pyx_v_idx, __pyx_t_3);
15657  __pyx_t_7 = __Pyx_PyInt_AddObjC(__pyx_t_3, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 675, __pyx_L1_error)
15658  __Pyx_GOTREF(__pyx_t_7);
15659  __Pyx_DECREF(__pyx_t_3);
15660  __pyx_t_3 = __pyx_t_7;
15661  __pyx_t_7 = 0;
15662 
15663  /* "View.MemoryView":676
15664  * seen_ellipsis = False
15665  * for idx, item in enumerate(tup):
15666  * if item is Ellipsis: # <<<<<<<<<<<<<<
15667  * if not seen_ellipsis:
15668  * result.extend([slice(None)] * (ndim - len(tup) + 1))
15669  */
15670  __pyx_t_2 = (__pyx_v_item == __pyx_builtin_Ellipsis);
15671  __pyx_t_1 = (__pyx_t_2 != 0);
15672  if (__pyx_t_1) {
15673 
15674  /* "View.MemoryView":677
15675  * for idx, item in enumerate(tup):
15676  * if item is Ellipsis:
15677  * if not seen_ellipsis: # <<<<<<<<<<<<<<
15678  * result.extend([slice(None)] * (ndim - len(tup) + 1))
15679  * seen_ellipsis = True
15680  */
15681  __pyx_t_1 = ((!(__pyx_v_seen_ellipsis != 0)) != 0);
15682  if (__pyx_t_1) {
15683 
15684  /* "View.MemoryView":678
15685  * if item is Ellipsis:
15686  * if not seen_ellipsis:
15687  * result.extend([slice(None)] * (ndim - len(tup) + 1)) # <<<<<<<<<<<<<<
15688  * seen_ellipsis = True
15689  * else:
15690  */
15691  __pyx_t_8 = PyObject_Length(__pyx_v_tup); if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(2, 678, __pyx_L1_error)
15692  __pyx_t_7 = PyList_New(1 * ((((__pyx_v_ndim - __pyx_t_8) + 1)<0) ? 0:((__pyx_v_ndim - __pyx_t_8) + 1))); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 678, __pyx_L1_error)
15693  __Pyx_GOTREF(__pyx_t_7);
15694  { Py_ssize_t __pyx_temp;
15695  for (__pyx_temp=0; __pyx_temp < ((__pyx_v_ndim - __pyx_t_8) + 1); __pyx_temp++) {
15696  __Pyx_INCREF(__pyx_slice__22);
15697  __Pyx_GIVEREF(__pyx_slice__22);
15698  PyList_SET_ITEM(__pyx_t_7, __pyx_temp, __pyx_slice__22);
15699  }
15700  }
15701  __pyx_t_9 = __Pyx_PyList_Extend(__pyx_v_result, __pyx_t_7); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(2, 678, __pyx_L1_error)
15702  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
15703 
15704  /* "View.MemoryView":679
15705  * if not seen_ellipsis:
15706  * result.extend([slice(None)] * (ndim - len(tup) + 1))
15707  * seen_ellipsis = True # <<<<<<<<<<<<<<
15708  * else:
15709  * result.append(slice(None))
15710  */
15711  __pyx_v_seen_ellipsis = 1;
15712 
15713  /* "View.MemoryView":677
15714  * for idx, item in enumerate(tup):
15715  * if item is Ellipsis:
15716  * if not seen_ellipsis: # <<<<<<<<<<<<<<
15717  * result.extend([slice(None)] * (ndim - len(tup) + 1))
15718  * seen_ellipsis = True
15719  */
15720  goto __pyx_L7;
15721  }
15722 
15723  /* "View.MemoryView":681
15724  * seen_ellipsis = True
15725  * else:
15726  * result.append(slice(None)) # <<<<<<<<<<<<<<
15727  * have_slices = True
15728  * else:
15729  */
15730  /*else*/ {
15731  __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_result, __pyx_slice__22); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(2, 681, __pyx_L1_error)
15732  }
15733  __pyx_L7:;
15734 
15735  /* "View.MemoryView":682
15736  * else:
15737  * result.append(slice(None))
15738  * have_slices = True # <<<<<<<<<<<<<<
15739  * else:
15740  * if not isinstance(item, slice) and not PyIndex_Check(item):
15741  */
15742  __pyx_v_have_slices = 1;
15743 
15744  /* "View.MemoryView":676
15745  * seen_ellipsis = False
15746  * for idx, item in enumerate(tup):
15747  * if item is Ellipsis: # <<<<<<<<<<<<<<
15748  * if not seen_ellipsis:
15749  * result.extend([slice(None)] * (ndim - len(tup) + 1))
15750  */
15751  goto __pyx_L6;
15752  }
15753 
15754  /* "View.MemoryView":684
15755  * have_slices = True
15756  * else:
15757  * if not isinstance(item, slice) and not PyIndex_Check(item): # <<<<<<<<<<<<<<
15758  * raise TypeError("Cannot index with type '%s'" % type(item))
15759  *
15760  */
15761  /*else*/ {
15762  __pyx_t_2 = PySlice_Check(__pyx_v_item);
15763  __pyx_t_10 = ((!(__pyx_t_2 != 0)) != 0);
15764  if (__pyx_t_10) {
15765  } else {
15766  __pyx_t_1 = __pyx_t_10;
15767  goto __pyx_L9_bool_binop_done;
15768  }
15769  __pyx_t_10 = ((!(PyIndex_Check(__pyx_v_item) != 0)) != 0);
15770  __pyx_t_1 = __pyx_t_10;
15771  __pyx_L9_bool_binop_done:;
15772  if (unlikely(__pyx_t_1)) {
15773 
15774  /* "View.MemoryView":685
15775  * else:
15776  * if not isinstance(item, slice) and not PyIndex_Check(item):
15777  * raise TypeError("Cannot index with type '%s'" % type(item)) # <<<<<<<<<<<<<<
15778  *
15779  * have_slices = have_slices or isinstance(item, slice)
15780  */
15781  __pyx_t_7 = __Pyx_PyString_FormatSafe(__pyx_kp_s_Cannot_index_with_type_s, ((PyObject *)Py_TYPE(__pyx_v_item))); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 685, __pyx_L1_error)
15782  __Pyx_GOTREF(__pyx_t_7);
15783  __pyx_t_11 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_7); if (unlikely(!__pyx_t_11)) __PYX_ERR(2, 685, __pyx_L1_error)
15784  __Pyx_GOTREF(__pyx_t_11);
15785  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
15786  __Pyx_Raise(__pyx_t_11, 0, 0, 0);
15787  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
15788  __PYX_ERR(2, 685, __pyx_L1_error)
15789 
15790  /* "View.MemoryView":684
15791  * have_slices = True
15792  * else:
15793  * if not isinstance(item, slice) and not PyIndex_Check(item): # <<<<<<<<<<<<<<
15794  * raise TypeError("Cannot index with type '%s'" % type(item))
15795  *
15796  */
15797  }
15798 
15799  /* "View.MemoryView":687
15800  * raise TypeError("Cannot index with type '%s'" % type(item))
15801  *
15802  * have_slices = have_slices or isinstance(item, slice) # <<<<<<<<<<<<<<
15803  * result.append(item)
15804  *
15805  */
15806  __pyx_t_10 = (__pyx_v_have_slices != 0);
15807  if (!__pyx_t_10) {
15808  } else {
15809  __pyx_t_1 = __pyx_t_10;
15810  goto __pyx_L11_bool_binop_done;
15811  }
15812  __pyx_t_10 = PySlice_Check(__pyx_v_item);
15813  __pyx_t_2 = (__pyx_t_10 != 0);
15814  __pyx_t_1 = __pyx_t_2;
15815  __pyx_L11_bool_binop_done:;
15816  __pyx_v_have_slices = __pyx_t_1;
15817 
15818  /* "View.MemoryView":688
15819  *
15820  * have_slices = have_slices or isinstance(item, slice)
15821  * result.append(item) # <<<<<<<<<<<<<<
15822  *
15823  * nslices = ndim - len(result)
15824  */
15825  __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_result, __pyx_v_item); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(2, 688, __pyx_L1_error)
15826  }
15827  __pyx_L6:;
15828 
15829  /* "View.MemoryView":675
15830  * have_slices = False
15831  * seen_ellipsis = False
15832  * for idx, item in enumerate(tup): # <<<<<<<<<<<<<<
15833  * if item is Ellipsis:
15834  * if not seen_ellipsis:
15835  */
15836  }
15837  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
15838  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15839 
15840  /* "View.MemoryView":690
15841  * result.append(item)
15842  *
15843  * nslices = ndim - len(result) # <<<<<<<<<<<<<<
15844  * if nslices:
15845  * result.extend([slice(None)] * nslices)
15846  */
15847  __pyx_t_5 = PyList_GET_SIZE(__pyx_v_result); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(2, 690, __pyx_L1_error)
15848  __pyx_v_nslices = (__pyx_v_ndim - __pyx_t_5);
15849 
15850  /* "View.MemoryView":691
15851  *
15852  * nslices = ndim - len(result)
15853  * if nslices: # <<<<<<<<<<<<<<
15854  * result.extend([slice(None)] * nslices)
15855  *
15856  */
15857  __pyx_t_1 = (__pyx_v_nslices != 0);
15858  if (__pyx_t_1) {
15859 
15860  /* "View.MemoryView":692
15861  * nslices = ndim - len(result)
15862  * if nslices:
15863  * result.extend([slice(None)] * nslices) # <<<<<<<<<<<<<<
15864  *
15865  * return have_slices or nslices, tuple(result)
15866  */
15867  __pyx_t_3 = PyList_New(1 * ((__pyx_v_nslices<0) ? 0:__pyx_v_nslices)); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 692, __pyx_L1_error)
15868  __Pyx_GOTREF(__pyx_t_3);
15869  { Py_ssize_t __pyx_temp;
15870  for (__pyx_temp=0; __pyx_temp < __pyx_v_nslices; __pyx_temp++) {
15871  __Pyx_INCREF(__pyx_slice__22);
15872  __Pyx_GIVEREF(__pyx_slice__22);
15873  PyList_SET_ITEM(__pyx_t_3, __pyx_temp, __pyx_slice__22);
15874  }
15875  }
15876  __pyx_t_9 = __Pyx_PyList_Extend(__pyx_v_result, __pyx_t_3); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(2, 692, __pyx_L1_error)
15877  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15878 
15879  /* "View.MemoryView":691
15880  *
15881  * nslices = ndim - len(result)
15882  * if nslices: # <<<<<<<<<<<<<<
15883  * result.extend([slice(None)] * nslices)
15884  *
15885  */
15886  }
15887 
15888  /* "View.MemoryView":694
15889  * result.extend([slice(None)] * nslices)
15890  *
15891  * return have_slices or nslices, tuple(result) # <<<<<<<<<<<<<<
15892  *
15893  * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim):
15894  */
15895  __Pyx_XDECREF(__pyx_r);
15896  if (!__pyx_v_have_slices) {
15897  } else {
15898  __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_v_have_slices); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 694, __pyx_L1_error)
15899  __Pyx_GOTREF(__pyx_t_4);
15900  __pyx_t_3 = __pyx_t_4;
15901  __pyx_t_4 = 0;
15902  goto __pyx_L14_bool_binop_done;
15903  }
15904  __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_nslices); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 694, __pyx_L1_error)
15905  __Pyx_GOTREF(__pyx_t_4);
15906  __pyx_t_3 = __pyx_t_4;
15907  __pyx_t_4 = 0;
15908  __pyx_L14_bool_binop_done:;
15909  __pyx_t_4 = PyList_AsTuple(__pyx_v_result); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 694, __pyx_L1_error)
15910  __Pyx_GOTREF(__pyx_t_4);
15911  __pyx_t_11 = PyTuple_New(2); if (unlikely(!__pyx_t_11)) __PYX_ERR(2, 694, __pyx_L1_error)
15912  __Pyx_GOTREF(__pyx_t_11);
15913  __Pyx_GIVEREF(__pyx_t_3);
15914  PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_3);
15915  __Pyx_GIVEREF(__pyx_t_4);
15916  PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_t_4);
15917  __pyx_t_3 = 0;
15918  __pyx_t_4 = 0;
15919  __pyx_r = ((PyObject*)__pyx_t_11);
15920  __pyx_t_11 = 0;
15921  goto __pyx_L0;
15922 
15923  /* "View.MemoryView":662
15924  * return isinstance(o, memoryview)
15925  *
15926  * cdef tuple _unellipsify(object index, int ndim): # <<<<<<<<<<<<<<
15927  * """
15928  * Replace all ellipses with full slices and fill incomplete indices with
15929  */
15930 
15931  /* function exit code */
15932  __pyx_L1_error:;
15933  __Pyx_XDECREF(__pyx_t_3);
15934  __Pyx_XDECREF(__pyx_t_4);
15935  __Pyx_XDECREF(__pyx_t_7);
15936  __Pyx_XDECREF(__pyx_t_11);
15937  __Pyx_AddTraceback("View.MemoryView._unellipsify", __pyx_clineno, __pyx_lineno, __pyx_filename);
15938  __pyx_r = 0;
15939  __pyx_L0:;
15940  __Pyx_XDECREF(__pyx_v_tup);
15941  __Pyx_XDECREF(__pyx_v_result);
15942  __Pyx_XDECREF(__pyx_v_idx);
15943  __Pyx_XDECREF(__pyx_v_item);
15944  __Pyx_XGIVEREF(__pyx_r);
15945  __Pyx_RefNannyFinishContext();
15946  return __pyx_r;
15947 }
15948 
15949 /* "View.MemoryView":696
15950  * return have_slices or nslices, tuple(result)
15951  *
15952  * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim): # <<<<<<<<<<<<<<
15953  * for suboffset in suboffsets[:ndim]:
15954  * if suboffset >= 0:
15955  */
15956 
15957 static PyObject *assert_direct_dimensions(Py_ssize_t *__pyx_v_suboffsets, int __pyx_v_ndim) {
15958  Py_ssize_t __pyx_v_suboffset;
15959  PyObject *__pyx_r = NULL;
15960  __Pyx_RefNannyDeclarations
15961  Py_ssize_t *__pyx_t_1;
15962  Py_ssize_t *__pyx_t_2;
15963  Py_ssize_t *__pyx_t_3;
15964  int __pyx_t_4;
15965  PyObject *__pyx_t_5 = NULL;
15966  __Pyx_RefNannySetupContext("assert_direct_dimensions", 0);
15967 
15968  /* "View.MemoryView":697
15969  *
15970  * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim):
15971  * for suboffset in suboffsets[:ndim]: # <<<<<<<<<<<<<<
15972  * if suboffset >= 0:
15973  * raise ValueError("Indirect dimensions not supported")
15974  */
15975  __pyx_t_2 = (__pyx_v_suboffsets + __pyx_v_ndim);
15976  for (__pyx_t_3 = __pyx_v_suboffsets; __pyx_t_3 < __pyx_t_2; __pyx_t_3++) {
15977  __pyx_t_1 = __pyx_t_3;
15978  __pyx_v_suboffset = (__pyx_t_1[0]);
15979 
15980  /* "View.MemoryView":698
15981  * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim):
15982  * for suboffset in suboffsets[:ndim]:
15983  * if suboffset >= 0: # <<<<<<<<<<<<<<
15984  * raise ValueError("Indirect dimensions not supported")
15985  *
15986  */
15987  __pyx_t_4 = ((__pyx_v_suboffset >= 0) != 0);
15988  if (unlikely(__pyx_t_4)) {
15989 
15990  /* "View.MemoryView":699
15991  * for suboffset in suboffsets[:ndim]:
15992  * if suboffset >= 0:
15993  * raise ValueError("Indirect dimensions not supported") # <<<<<<<<<<<<<<
15994  *
15995  *
15996  */
15997  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__23, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 699, __pyx_L1_error)
15998  __Pyx_GOTREF(__pyx_t_5);
15999  __Pyx_Raise(__pyx_t_5, 0, 0, 0);
16000  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
16001  __PYX_ERR(2, 699, __pyx_L1_error)
16002 
16003  /* "View.MemoryView":698
16004  * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim):
16005  * for suboffset in suboffsets[:ndim]:
16006  * if suboffset >= 0: # <<<<<<<<<<<<<<
16007  * raise ValueError("Indirect dimensions not supported")
16008  *
16009  */
16010  }
16011  }
16012 
16013  /* "View.MemoryView":696
16014  * return have_slices or nslices, tuple(result)
16015  *
16016  * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim): # <<<<<<<<<<<<<<
16017  * for suboffset in suboffsets[:ndim]:
16018  * if suboffset >= 0:
16019  */
16020 
16021  /* function exit code */
16022  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
16023  goto __pyx_L0;
16024  __pyx_L1_error:;
16025  __Pyx_XDECREF(__pyx_t_5);
16026  __Pyx_AddTraceback("View.MemoryView.assert_direct_dimensions", __pyx_clineno, __pyx_lineno, __pyx_filename);
16027  __pyx_r = 0;
16028  __pyx_L0:;
16029  __Pyx_XGIVEREF(__pyx_r);
16030  __Pyx_RefNannyFinishContext();
16031  return __pyx_r;
16032 }
16033 
16034 /* "View.MemoryView":706
16035  *
16036  * @cname('__pyx_memview_slice')
16037  * cdef memoryview memview_slice(memoryview memview, object indices): # <<<<<<<<<<<<<<
16038  * cdef int new_ndim = 0, suboffset_dim = -1, dim
16039  * cdef bint negative_step
16040  */
16041 
16042 static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_obj *__pyx_v_memview, PyObject *__pyx_v_indices) {
16043  int __pyx_v_new_ndim;
16044  int __pyx_v_suboffset_dim;
16045  int __pyx_v_dim;
16046  __Pyx_memviewslice __pyx_v_src;
16047  __Pyx_memviewslice __pyx_v_dst;
16048  __Pyx_memviewslice *__pyx_v_p_src;
16049  struct __pyx_memoryviewslice_obj *__pyx_v_memviewsliceobj = 0;
16050  __Pyx_memviewslice *__pyx_v_p_dst;
16051  int *__pyx_v_p_suboffset_dim;
16052  Py_ssize_t __pyx_v_start;
16053  Py_ssize_t __pyx_v_stop;
16054  Py_ssize_t __pyx_v_step;
16055  int __pyx_v_have_start;
16056  int __pyx_v_have_stop;
16057  int __pyx_v_have_step;
16058  PyObject *__pyx_v_index = NULL;
16059  struct __pyx_memoryview_obj *__pyx_r = NULL;
16060  __Pyx_RefNannyDeclarations
16061  int __pyx_t_1;
16062  int __pyx_t_2;
16063  PyObject *__pyx_t_3 = NULL;
16064  struct __pyx_memoryview_obj *__pyx_t_4;
16065  char *__pyx_t_5;
16066  int __pyx_t_6;
16067  Py_ssize_t __pyx_t_7;
16068  PyObject *(*__pyx_t_8)(PyObject *);
16069  PyObject *__pyx_t_9 = NULL;
16070  Py_ssize_t __pyx_t_10;
16071  int __pyx_t_11;
16072  Py_ssize_t __pyx_t_12;
16073  __Pyx_RefNannySetupContext("memview_slice", 0);
16074 
16075  /* "View.MemoryView":707
16076  * @cname('__pyx_memview_slice')
16077  * cdef memoryview memview_slice(memoryview memview, object indices):
16078  * cdef int new_ndim = 0, suboffset_dim = -1, dim # <<<<<<<<<<<<<<
16079  * cdef bint negative_step
16080  * cdef __Pyx_memviewslice src, dst
16081  */
16082  __pyx_v_new_ndim = 0;
16083  __pyx_v_suboffset_dim = -1;
16084 
16085  /* "View.MemoryView":714
16086  *
16087  *
16088  * memset(&dst, 0, sizeof(dst)) # <<<<<<<<<<<<<<
16089  *
16090  * cdef _memoryviewslice memviewsliceobj
16091  */
16092  (void)(memset((&__pyx_v_dst), 0, (sizeof(__pyx_v_dst))));
16093 
16094  /* "View.MemoryView":718
16095  * cdef _memoryviewslice memviewsliceobj
16096  *
16097  * assert memview.view.ndim > 0 # <<<<<<<<<<<<<<
16098  *
16099  * if isinstance(memview, _memoryviewslice):
16100  */
16101  #ifndef CYTHON_WITHOUT_ASSERTIONS
16102  if (unlikely(!Py_OptimizeFlag)) {
16103  if (unlikely(!((__pyx_v_memview->view.ndim > 0) != 0))) {
16104  PyErr_SetNone(PyExc_AssertionError);
16105  __PYX_ERR(2, 718, __pyx_L1_error)
16106  }
16107  }
16108  #endif
16109 
16110  /* "View.MemoryView":720
16111  * assert memview.view.ndim > 0
16112  *
16113  * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
16114  * memviewsliceobj = memview
16115  * p_src = &memviewsliceobj.from_slice
16116  */
16117  __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
16118  __pyx_t_2 = (__pyx_t_1 != 0);
16119  if (__pyx_t_2) {
16120 
16121  /* "View.MemoryView":721
16122  *
16123  * if isinstance(memview, _memoryviewslice):
16124  * memviewsliceobj = memview # <<<<<<<<<<<<<<
16125  * p_src = &memviewsliceobj.from_slice
16126  * else:
16127  */
16128  if (!(likely(((((PyObject *)__pyx_v_memview)) == Py_None) || likely(__Pyx_TypeTest(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type))))) __PYX_ERR(2, 721, __pyx_L1_error)
16129  __pyx_t_3 = ((PyObject *)__pyx_v_memview);
16130  __Pyx_INCREF(__pyx_t_3);
16131  __pyx_v_memviewsliceobj = ((struct __pyx_memoryviewslice_obj *)__pyx_t_3);
16132  __pyx_t_3 = 0;
16133 
16134  /* "View.MemoryView":722
16135  * if isinstance(memview, _memoryviewslice):
16136  * memviewsliceobj = memview
16137  * p_src = &memviewsliceobj.from_slice # <<<<<<<<<<<<<<
16138  * else:
16139  * slice_copy(memview, &src)
16140  */
16141  __pyx_v_p_src = (&__pyx_v_memviewsliceobj->from_slice);
16142 
16143  /* "View.MemoryView":720
16144  * assert memview.view.ndim > 0
16145  *
16146  * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
16147  * memviewsliceobj = memview
16148  * p_src = &memviewsliceobj.from_slice
16149  */
16150  goto __pyx_L3;
16151  }
16152 
16153  /* "View.MemoryView":724
16154  * p_src = &memviewsliceobj.from_slice
16155  * else:
16156  * slice_copy(memview, &src) # <<<<<<<<<<<<<<
16157  * p_src = &src
16158  *
16159  */
16160  /*else*/ {
16161  __pyx_memoryview_slice_copy(__pyx_v_memview, (&__pyx_v_src));
16162 
16163  /* "View.MemoryView":725
16164  * else:
16165  * slice_copy(memview, &src)
16166  * p_src = &src # <<<<<<<<<<<<<<
16167  *
16168  *
16169  */
16170  __pyx_v_p_src = (&__pyx_v_src);
16171  }
16172  __pyx_L3:;
16173 
16174  /* "View.MemoryView":731
16175  *
16176  *
16177  * dst.memview = p_src.memview # <<<<<<<<<<<<<<
16178  * dst.data = p_src.data
16179  *
16180  */
16181  __pyx_t_4 = __pyx_v_p_src->memview;
16182  __pyx_v_dst.memview = __pyx_t_4;
16183 
16184  /* "View.MemoryView":732
16185  *
16186  * dst.memview = p_src.memview
16187  * dst.data = p_src.data # <<<<<<<<<<<<<<
16188  *
16189  *
16190  */
16191  __pyx_t_5 = __pyx_v_p_src->data;
16192  __pyx_v_dst.data = __pyx_t_5;
16193 
16194  /* "View.MemoryView":737
16195  *
16196  *
16197  * cdef __Pyx_memviewslice *p_dst = &dst # <<<<<<<<<<<<<<
16198  * cdef int *p_suboffset_dim = &suboffset_dim
16199  * cdef Py_ssize_t start, stop, step
16200  */
16201  __pyx_v_p_dst = (&__pyx_v_dst);
16202 
16203  /* "View.MemoryView":738
16204  *
16205  * cdef __Pyx_memviewslice *p_dst = &dst
16206  * cdef int *p_suboffset_dim = &suboffset_dim # <<<<<<<<<<<<<<
16207  * cdef Py_ssize_t start, stop, step
16208  * cdef bint have_start, have_stop, have_step
16209  */
16210  __pyx_v_p_suboffset_dim = (&__pyx_v_suboffset_dim);
16211 
16212  /* "View.MemoryView":742
16213  * cdef bint have_start, have_stop, have_step
16214  *
16215  * for dim, index in enumerate(indices): # <<<<<<<<<<<<<<
16216  * if PyIndex_Check(index):
16217  * slice_memviewslice(
16218  */
16219  __pyx_t_6 = 0;
16220  if (likely(PyList_CheckExact(__pyx_v_indices)) || PyTuple_CheckExact(__pyx_v_indices)) {
16221  __pyx_t_3 = __pyx_v_indices; __Pyx_INCREF(__pyx_t_3); __pyx_t_7 = 0;
16222  __pyx_t_8 = NULL;
16223  } else {
16224  __pyx_t_7 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_indices); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 742, __pyx_L1_error)
16225  __Pyx_GOTREF(__pyx_t_3);
16226  __pyx_t_8 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 742, __pyx_L1_error)
16227  }
16228  for (;;) {
16229  if (likely(!__pyx_t_8)) {
16230  if (likely(PyList_CheckExact(__pyx_t_3))) {
16231  if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_3)) break;
16232  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
16233  __pyx_t_9 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_9); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(2, 742, __pyx_L1_error)
16234  #else
16235  __pyx_t_9 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 742, __pyx_L1_error)
16236  __Pyx_GOTREF(__pyx_t_9);
16237  #endif
16238  } else {
16239  if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
16240  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
16241  __pyx_t_9 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_9); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(2, 742, __pyx_L1_error)
16242  #else
16243  __pyx_t_9 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 742, __pyx_L1_error)
16244  __Pyx_GOTREF(__pyx_t_9);
16245  #endif
16246  }
16247  } else {
16248  __pyx_t_9 = __pyx_t_8(__pyx_t_3);
16249  if (unlikely(!__pyx_t_9)) {
16250  PyObject* exc_type = PyErr_Occurred();
16251  if (exc_type) {
16252  if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
16253  else __PYX_ERR(2, 742, __pyx_L1_error)
16254  }
16255  break;
16256  }
16257  __Pyx_GOTREF(__pyx_t_9);
16258  }
16259  __Pyx_XDECREF_SET(__pyx_v_index, __pyx_t_9);
16260  __pyx_t_9 = 0;
16261  __pyx_v_dim = __pyx_t_6;
16262  __pyx_t_6 = (__pyx_t_6 + 1);
16263 
16264  /* "View.MemoryView":743
16265  *
16266  * for dim, index in enumerate(indices):
16267  * if PyIndex_Check(index): # <<<<<<<<<<<<<<
16268  * slice_memviewslice(
16269  * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim],
16270  */
16271  __pyx_t_2 = (PyIndex_Check(__pyx_v_index) != 0);
16272  if (__pyx_t_2) {
16273 
16274  /* "View.MemoryView":747
16275  * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim],
16276  * dim, new_ndim, p_suboffset_dim,
16277  * index, 0, 0, # start, stop, step # <<<<<<<<<<<<<<
16278  * 0, 0, 0, # have_{start,stop,step}
16279  * False)
16280  */
16281  __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_v_index); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(2, 747, __pyx_L1_error)
16282 
16283  /* "View.MemoryView":744
16284  * for dim, index in enumerate(indices):
16285  * if PyIndex_Check(index):
16286  * slice_memviewslice( # <<<<<<<<<<<<<<
16287  * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim],
16288  * dim, new_ndim, p_suboffset_dim,
16289  */
16290  __pyx_t_11 = __pyx_memoryview_slice_memviewslice(__pyx_v_p_dst, (__pyx_v_p_src->shape[__pyx_v_dim]), (__pyx_v_p_src->strides[__pyx_v_dim]), (__pyx_v_p_src->suboffsets[__pyx_v_dim]), __pyx_v_dim, __pyx_v_new_ndim, __pyx_v_p_suboffset_dim, __pyx_t_10, 0, 0, 0, 0, 0, 0); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(2, 744, __pyx_L1_error)
16291 
16292  /* "View.MemoryView":743
16293  *
16294  * for dim, index in enumerate(indices):
16295  * if PyIndex_Check(index): # <<<<<<<<<<<<<<
16296  * slice_memviewslice(
16297  * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim],
16298  */
16299  goto __pyx_L6;
16300  }
16301 
16302  /* "View.MemoryView":750
16303  * 0, 0, 0, # have_{start,stop,step}
16304  * False)
16305  * elif index is None: # <<<<<<<<<<<<<<
16306  * p_dst.shape[new_ndim] = 1
16307  * p_dst.strides[new_ndim] = 0
16308  */
16309  __pyx_t_2 = (__pyx_v_index == Py_None);
16310  __pyx_t_1 = (__pyx_t_2 != 0);
16311  if (__pyx_t_1) {
16312 
16313  /* "View.MemoryView":751
16314  * False)
16315  * elif index is None:
16316  * p_dst.shape[new_ndim] = 1 # <<<<<<<<<<<<<<
16317  * p_dst.strides[new_ndim] = 0
16318  * p_dst.suboffsets[new_ndim] = -1
16319  */
16320  (__pyx_v_p_dst->shape[__pyx_v_new_ndim]) = 1;
16321 
16322  /* "View.MemoryView":752
16323  * elif index is None:
16324  * p_dst.shape[new_ndim] = 1
16325  * p_dst.strides[new_ndim] = 0 # <<<<<<<<<<<<<<
16326  * p_dst.suboffsets[new_ndim] = -1
16327  * new_ndim += 1
16328  */
16329  (__pyx_v_p_dst->strides[__pyx_v_new_ndim]) = 0;
16330 
16331  /* "View.MemoryView":753
16332  * p_dst.shape[new_ndim] = 1
16333  * p_dst.strides[new_ndim] = 0
16334  * p_dst.suboffsets[new_ndim] = -1 # <<<<<<<<<<<<<<
16335  * new_ndim += 1
16336  * else:
16337  */
16338  (__pyx_v_p_dst->suboffsets[__pyx_v_new_ndim]) = -1L;
16339 
16340  /* "View.MemoryView":754
16341  * p_dst.strides[new_ndim] = 0
16342  * p_dst.suboffsets[new_ndim] = -1
16343  * new_ndim += 1 # <<<<<<<<<<<<<<
16344  * else:
16345  * start = index.start or 0
16346  */
16347  __pyx_v_new_ndim = (__pyx_v_new_ndim + 1);
16348 
16349  /* "View.MemoryView":750
16350  * 0, 0, 0, # have_{start,stop,step}
16351  * False)
16352  * elif index is None: # <<<<<<<<<<<<<<
16353  * p_dst.shape[new_ndim] = 1
16354  * p_dst.strides[new_ndim] = 0
16355  */
16356  goto __pyx_L6;
16357  }
16358 
16359  /* "View.MemoryView":756
16360  * new_ndim += 1
16361  * else:
16362  * start = index.start or 0 # <<<<<<<<<<<<<<
16363  * stop = index.stop or 0
16364  * step = index.step or 0
16365  */
16366  /*else*/ {
16367  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_start); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 756, __pyx_L1_error)
16368  __Pyx_GOTREF(__pyx_t_9);
16369  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(2, 756, __pyx_L1_error)
16370  if (!__pyx_t_1) {
16371  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
16372  } else {
16373  __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(2, 756, __pyx_L1_error)
16374  __pyx_t_10 = __pyx_t_12;
16375  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
16376  goto __pyx_L7_bool_binop_done;
16377  }
16378  __pyx_t_10 = 0;
16379  __pyx_L7_bool_binop_done:;
16380  __pyx_v_start = __pyx_t_10;
16381 
16382  /* "View.MemoryView":757
16383  * else:
16384  * start = index.start or 0
16385  * stop = index.stop or 0 # <<<<<<<<<<<<<<
16386  * step = index.step or 0
16387  *
16388  */
16389  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_stop); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 757, __pyx_L1_error)
16390  __Pyx_GOTREF(__pyx_t_9);
16391  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(2, 757, __pyx_L1_error)
16392  if (!__pyx_t_1) {
16393  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
16394  } else {
16395  __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(2, 757, __pyx_L1_error)
16396  __pyx_t_10 = __pyx_t_12;
16397  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
16398  goto __pyx_L9_bool_binop_done;
16399  }
16400  __pyx_t_10 = 0;
16401  __pyx_L9_bool_binop_done:;
16402  __pyx_v_stop = __pyx_t_10;
16403 
16404  /* "View.MemoryView":758
16405  * start = index.start or 0
16406  * stop = index.stop or 0
16407  * step = index.step or 0 # <<<<<<<<<<<<<<
16408  *
16409  * have_start = index.start is not None
16410  */
16411  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_step); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 758, __pyx_L1_error)
16412  __Pyx_GOTREF(__pyx_t_9);
16413  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(2, 758, __pyx_L1_error)
16414  if (!__pyx_t_1) {
16415  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
16416  } else {
16417  __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(2, 758, __pyx_L1_error)
16418  __pyx_t_10 = __pyx_t_12;
16419  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
16420  goto __pyx_L11_bool_binop_done;
16421  }
16422  __pyx_t_10 = 0;
16423  __pyx_L11_bool_binop_done:;
16424  __pyx_v_step = __pyx_t_10;
16425 
16426  /* "View.MemoryView":760
16427  * step = index.step or 0
16428  *
16429  * have_start = index.start is not None # <<<<<<<<<<<<<<
16430  * have_stop = index.stop is not None
16431  * have_step = index.step is not None
16432  */
16433  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_start); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 760, __pyx_L1_error)
16434  __Pyx_GOTREF(__pyx_t_9);
16435  __pyx_t_1 = (__pyx_t_9 != Py_None);
16436  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
16437  __pyx_v_have_start = __pyx_t_1;
16438 
16439  /* "View.MemoryView":761
16440  *
16441  * have_start = index.start is not None
16442  * have_stop = index.stop is not None # <<<<<<<<<<<<<<
16443  * have_step = index.step is not None
16444  *
16445  */
16446  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_stop); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 761, __pyx_L1_error)
16447  __Pyx_GOTREF(__pyx_t_9);
16448  __pyx_t_1 = (__pyx_t_9 != Py_None);
16449  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
16450  __pyx_v_have_stop = __pyx_t_1;
16451 
16452  /* "View.MemoryView":762
16453  * have_start = index.start is not None
16454  * have_stop = index.stop is not None
16455  * have_step = index.step is not None # <<<<<<<<<<<<<<
16456  *
16457  * slice_memviewslice(
16458  */
16459  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_step); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 762, __pyx_L1_error)
16460  __Pyx_GOTREF(__pyx_t_9);
16461  __pyx_t_1 = (__pyx_t_9 != Py_None);
16462  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
16463  __pyx_v_have_step = __pyx_t_1;
16464 
16465  /* "View.MemoryView":764
16466  * have_step = index.step is not None
16467  *
16468  * slice_memviewslice( # <<<<<<<<<<<<<<
16469  * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim],
16470  * dim, new_ndim, p_suboffset_dim,
16471  */
16472  __pyx_t_11 = __pyx_memoryview_slice_memviewslice(__pyx_v_p_dst, (__pyx_v_p_src->shape[__pyx_v_dim]), (__pyx_v_p_src->strides[__pyx_v_dim]), (__pyx_v_p_src->suboffsets[__pyx_v_dim]), __pyx_v_dim, __pyx_v_new_ndim, __pyx_v_p_suboffset_dim, __pyx_v_start, __pyx_v_stop, __pyx_v_step, __pyx_v_have_start, __pyx_v_have_stop, __pyx_v_have_step, 1); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(2, 764, __pyx_L1_error)
16473 
16474  /* "View.MemoryView":770
16475  * have_start, have_stop, have_step,
16476  * True)
16477  * new_ndim += 1 # <<<<<<<<<<<<<<
16478  *
16479  * if isinstance(memview, _memoryviewslice):
16480  */
16481  __pyx_v_new_ndim = (__pyx_v_new_ndim + 1);
16482  }
16483  __pyx_L6:;
16484 
16485  /* "View.MemoryView":742
16486  * cdef bint have_start, have_stop, have_step
16487  *
16488  * for dim, index in enumerate(indices): # <<<<<<<<<<<<<<
16489  * if PyIndex_Check(index):
16490  * slice_memviewslice(
16491  */
16492  }
16493  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
16494 
16495  /* "View.MemoryView":772
16496  * new_ndim += 1
16497  *
16498  * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
16499  * return memoryview_fromslice(dst, new_ndim,
16500  * memviewsliceobj.to_object_func,
16501  */
16502  __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
16503  __pyx_t_2 = (__pyx_t_1 != 0);
16504  if (__pyx_t_2) {
16505 
16506  /* "View.MemoryView":773
16507  *
16508  * if isinstance(memview, _memoryviewslice):
16509  * return memoryview_fromslice(dst, new_ndim, # <<<<<<<<<<<<<<
16510  * memviewsliceobj.to_object_func,
16511  * memviewsliceobj.to_dtype_func,
16512  */
16513  __Pyx_XDECREF(((PyObject *)__pyx_r));
16514 
16515  /* "View.MemoryView":774
16516  * if isinstance(memview, _memoryviewslice):
16517  * return memoryview_fromslice(dst, new_ndim,
16518  * memviewsliceobj.to_object_func, # <<<<<<<<<<<<<<
16519  * memviewsliceobj.to_dtype_func,
16520  * memview.dtype_is_object)
16521  */
16522  if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError("memviewsliceobj"); __PYX_ERR(2, 774, __pyx_L1_error) }
16523 
16524  /* "View.MemoryView":775
16525  * return memoryview_fromslice(dst, new_ndim,
16526  * memviewsliceobj.to_object_func,
16527  * memviewsliceobj.to_dtype_func, # <<<<<<<<<<<<<<
16528  * memview.dtype_is_object)
16529  * else:
16530  */
16531  if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError("memviewsliceobj"); __PYX_ERR(2, 775, __pyx_L1_error) }
16532 
16533  /* "View.MemoryView":773
16534  *
16535  * if isinstance(memview, _memoryviewslice):
16536  * return memoryview_fromslice(dst, new_ndim, # <<<<<<<<<<<<<<
16537  * memviewsliceobj.to_object_func,
16538  * memviewsliceobj.to_dtype_func,
16539  */
16540  __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_dst, __pyx_v_new_ndim, __pyx_v_memviewsliceobj->to_object_func, __pyx_v_memviewsliceobj->to_dtype_func, __pyx_v_memview->dtype_is_object); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 773, __pyx_L1_error)
16541  __Pyx_GOTREF(__pyx_t_3);
16542  if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) __PYX_ERR(2, 773, __pyx_L1_error)
16543  __pyx_r = ((struct __pyx_memoryview_obj *)__pyx_t_3);
16544  __pyx_t_3 = 0;
16545  goto __pyx_L0;
16546 
16547  /* "View.MemoryView":772
16548  * new_ndim += 1
16549  *
16550  * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
16551  * return memoryview_fromslice(dst, new_ndim,
16552  * memviewsliceobj.to_object_func,
16553  */
16554  }
16555 
16556  /* "View.MemoryView":778
16557  * memview.dtype_is_object)
16558  * else:
16559  * return memoryview_fromslice(dst, new_ndim, NULL, NULL, # <<<<<<<<<<<<<<
16560  * memview.dtype_is_object)
16561  *
16562  */
16563  /*else*/ {
16564  __Pyx_XDECREF(((PyObject *)__pyx_r));
16565 
16566  /* "View.MemoryView":779
16567  * else:
16568  * return memoryview_fromslice(dst, new_ndim, NULL, NULL,
16569  * memview.dtype_is_object) # <<<<<<<<<<<<<<
16570  *
16571  *
16572  */
16573  __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_dst, __pyx_v_new_ndim, NULL, NULL, __pyx_v_memview->dtype_is_object); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 778, __pyx_L1_error)
16574  __Pyx_GOTREF(__pyx_t_3);
16575 
16576  /* "View.MemoryView":778
16577  * memview.dtype_is_object)
16578  * else:
16579  * return memoryview_fromslice(dst, new_ndim, NULL, NULL, # <<<<<<<<<<<<<<
16580  * memview.dtype_is_object)
16581  *
16582  */
16583  if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) __PYX_ERR(2, 778, __pyx_L1_error)
16584  __pyx_r = ((struct __pyx_memoryview_obj *)__pyx_t_3);
16585  __pyx_t_3 = 0;
16586  goto __pyx_L0;
16587  }
16588 
16589  /* "View.MemoryView":706
16590  *
16591  * @cname('__pyx_memview_slice')
16592  * cdef memoryview memview_slice(memoryview memview, object indices): # <<<<<<<<<<<<<<
16593  * cdef int new_ndim = 0, suboffset_dim = -1, dim
16594  * cdef bint negative_step
16595  */
16596 
16597  /* function exit code */
16598  __pyx_L1_error:;
16599  __Pyx_XDECREF(__pyx_t_3);
16600  __Pyx_XDECREF(__pyx_t_9);
16601  __Pyx_AddTraceback("View.MemoryView.memview_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
16602  __pyx_r = 0;
16603  __pyx_L0:;
16604  __Pyx_XDECREF((PyObject *)__pyx_v_memviewsliceobj);
16605  __Pyx_XDECREF(__pyx_v_index);
16606  __Pyx_XGIVEREF((PyObject *)__pyx_r);
16607  __Pyx_RefNannyFinishContext();
16608  return __pyx_r;
16609 }
16610 
16611 /* "View.MemoryView":803
16612  *
16613  * @cname('__pyx_memoryview_slice_memviewslice')
16614  * cdef int slice_memviewslice( # <<<<<<<<<<<<<<
16615  * __Pyx_memviewslice *dst,
16616  * Py_ssize_t shape, Py_ssize_t stride, Py_ssize_t suboffset,
16617  */
16618 
16619 static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, Py_ssize_t __pyx_v_shape, Py_ssize_t __pyx_v_stride, Py_ssize_t __pyx_v_suboffset, int __pyx_v_dim, int __pyx_v_new_ndim, int *__pyx_v_suboffset_dim, Py_ssize_t __pyx_v_start, Py_ssize_t __pyx_v_stop, Py_ssize_t __pyx_v_step, int __pyx_v_have_start, int __pyx_v_have_stop, int __pyx_v_have_step, int __pyx_v_is_slice) {
16620  Py_ssize_t __pyx_v_new_shape;
16621  int __pyx_v_negative_step;
16622  int __pyx_r;
16623  int __pyx_t_1;
16624  int __pyx_t_2;
16625  int __pyx_t_3;
16626 
16627  /* "View.MemoryView":823
16628  * cdef bint negative_step
16629  *
16630  * if not is_slice: # <<<<<<<<<<<<<<
16631  *
16632  * if start < 0:
16633  */
16634  __pyx_t_1 = ((!(__pyx_v_is_slice != 0)) != 0);
16635  if (__pyx_t_1) {
16636 
16637  /* "View.MemoryView":825
16638  * if not is_slice:
16639  *
16640  * if start < 0: # <<<<<<<<<<<<<<
16641  * start += shape
16642  * if not 0 <= start < shape:
16643  */
16644  __pyx_t_1 = ((__pyx_v_start < 0) != 0);
16645  if (__pyx_t_1) {
16646 
16647  /* "View.MemoryView":826
16648  *
16649  * if start < 0:
16650  * start += shape # <<<<<<<<<<<<<<
16651  * if not 0 <= start < shape:
16652  * _err_dim(IndexError, "Index out of bounds (axis %d)", dim)
16653  */
16654  __pyx_v_start = (__pyx_v_start + __pyx_v_shape);
16655 
16656  /* "View.MemoryView":825
16657  * if not is_slice:
16658  *
16659  * if start < 0: # <<<<<<<<<<<<<<
16660  * start += shape
16661  * if not 0 <= start < shape:
16662  */
16663  }
16664 
16665  /* "View.MemoryView":827
16666  * if start < 0:
16667  * start += shape
16668  * if not 0 <= start < shape: # <<<<<<<<<<<<<<
16669  * _err_dim(IndexError, "Index out of bounds (axis %d)", dim)
16670  * else:
16671  */
16672  __pyx_t_1 = (0 <= __pyx_v_start);
16673  if (__pyx_t_1) {
16674  __pyx_t_1 = (__pyx_v_start < __pyx_v_shape);
16675  }
16676  __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
16677  if (__pyx_t_2) {
16678 
16679  /* "View.MemoryView":828
16680  * start += shape
16681  * if not 0 <= start < shape:
16682  * _err_dim(IndexError, "Index out of bounds (axis %d)", dim) # <<<<<<<<<<<<<<
16683  * else:
16684  *
16685  */
16686  __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_IndexError, ((char *)"Index out of bounds (axis %d)"), __pyx_v_dim); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(2, 828, __pyx_L1_error)
16687 
16688  /* "View.MemoryView":827
16689  * if start < 0:
16690  * start += shape
16691  * if not 0 <= start < shape: # <<<<<<<<<<<<<<
16692  * _err_dim(IndexError, "Index out of bounds (axis %d)", dim)
16693  * else:
16694  */
16695  }
16696 
16697  /* "View.MemoryView":823
16698  * cdef bint negative_step
16699  *
16700  * if not is_slice: # <<<<<<<<<<<<<<
16701  *
16702  * if start < 0:
16703  */
16704  goto __pyx_L3;
16705  }
16706 
16707  /* "View.MemoryView":831
16708  * else:
16709  *
16710  * negative_step = have_step != 0 and step < 0 # <<<<<<<<<<<<<<
16711  *
16712  * if have_step and step == 0:
16713  */
16714  /*else*/ {
16715  __pyx_t_1 = ((__pyx_v_have_step != 0) != 0);
16716  if (__pyx_t_1) {
16717  } else {
16718  __pyx_t_2 = __pyx_t_1;
16719  goto __pyx_L6_bool_binop_done;
16720  }
16721  __pyx_t_1 = ((__pyx_v_step < 0) != 0);
16722  __pyx_t_2 = __pyx_t_1;
16723  __pyx_L6_bool_binop_done:;
16724  __pyx_v_negative_step = __pyx_t_2;
16725 
16726  /* "View.MemoryView":833
16727  * negative_step = have_step != 0 and step < 0
16728  *
16729  * if have_step and step == 0: # <<<<<<<<<<<<<<
16730  * _err_dim(ValueError, "Step may not be zero (axis %d)", dim)
16731  *
16732  */
16733  __pyx_t_1 = (__pyx_v_have_step != 0);
16734  if (__pyx_t_1) {
16735  } else {
16736  __pyx_t_2 = __pyx_t_1;
16737  goto __pyx_L9_bool_binop_done;
16738  }
16739  __pyx_t_1 = ((__pyx_v_step == 0) != 0);
16740  __pyx_t_2 = __pyx_t_1;
16741  __pyx_L9_bool_binop_done:;
16742  if (__pyx_t_2) {
16743 
16744  /* "View.MemoryView":834
16745  *
16746  * if have_step and step == 0:
16747  * _err_dim(ValueError, "Step may not be zero (axis %d)", dim) # <<<<<<<<<<<<<<
16748  *
16749  *
16750  */
16751  __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_ValueError, ((char *)"Step may not be zero (axis %d)"), __pyx_v_dim); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(2, 834, __pyx_L1_error)
16752 
16753  /* "View.MemoryView":833
16754  * negative_step = have_step != 0 and step < 0
16755  *
16756  * if have_step and step == 0: # <<<<<<<<<<<<<<
16757  * _err_dim(ValueError, "Step may not be zero (axis %d)", dim)
16758  *
16759  */
16760  }
16761 
16762  /* "View.MemoryView":837
16763  *
16764  *
16765  * if have_start: # <<<<<<<<<<<<<<
16766  * if start < 0:
16767  * start += shape
16768  */
16769  __pyx_t_2 = (__pyx_v_have_start != 0);
16770  if (__pyx_t_2) {
16771 
16772  /* "View.MemoryView":838
16773  *
16774  * if have_start:
16775  * if start < 0: # <<<<<<<<<<<<<<
16776  * start += shape
16777  * if start < 0:
16778  */
16779  __pyx_t_2 = ((__pyx_v_start < 0) != 0);
16780  if (__pyx_t_2) {
16781 
16782  /* "View.MemoryView":839
16783  * if have_start:
16784  * if start < 0:
16785  * start += shape # <<<<<<<<<<<<<<
16786  * if start < 0:
16787  * start = 0
16788  */
16789  __pyx_v_start = (__pyx_v_start + __pyx_v_shape);
16790 
16791  /* "View.MemoryView":840
16792  * if start < 0:
16793  * start += shape
16794  * if start < 0: # <<<<<<<<<<<<<<
16795  * start = 0
16796  * elif start >= shape:
16797  */
16798  __pyx_t_2 = ((__pyx_v_start < 0) != 0);
16799  if (__pyx_t_2) {
16800 
16801  /* "View.MemoryView":841
16802  * start += shape
16803  * if start < 0:
16804  * start = 0 # <<<<<<<<<<<<<<
16805  * elif start >= shape:
16806  * if negative_step:
16807  */
16808  __pyx_v_start = 0;
16809 
16810  /* "View.MemoryView":840
16811  * if start < 0:
16812  * start += shape
16813  * if start < 0: # <<<<<<<<<<<<<<
16814  * start = 0
16815  * elif start >= shape:
16816  */
16817  }
16818 
16819  /* "View.MemoryView":838
16820  *
16821  * if have_start:
16822  * if start < 0: # <<<<<<<<<<<<<<
16823  * start += shape
16824  * if start < 0:
16825  */
16826  goto __pyx_L12;
16827  }
16828 
16829  /* "View.MemoryView":842
16830  * if start < 0:
16831  * start = 0
16832  * elif start >= shape: # <<<<<<<<<<<<<<
16833  * if negative_step:
16834  * start = shape - 1
16835  */
16836  __pyx_t_2 = ((__pyx_v_start >= __pyx_v_shape) != 0);
16837  if (__pyx_t_2) {
16838 
16839  /* "View.MemoryView":843
16840  * start = 0
16841  * elif start >= shape:
16842  * if negative_step: # <<<<<<<<<<<<<<
16843  * start = shape - 1
16844  * else:
16845  */
16846  __pyx_t_2 = (__pyx_v_negative_step != 0);
16847  if (__pyx_t_2) {
16848 
16849  /* "View.MemoryView":844
16850  * elif start >= shape:
16851  * if negative_step:
16852  * start = shape - 1 # <<<<<<<<<<<<<<
16853  * else:
16854  * start = shape
16855  */
16856  __pyx_v_start = (__pyx_v_shape - 1);
16857 
16858  /* "View.MemoryView":843
16859  * start = 0
16860  * elif start >= shape:
16861  * if negative_step: # <<<<<<<<<<<<<<
16862  * start = shape - 1
16863  * else:
16864  */
16865  goto __pyx_L14;
16866  }
16867 
16868  /* "View.MemoryView":846
16869  * start = shape - 1
16870  * else:
16871  * start = shape # <<<<<<<<<<<<<<
16872  * else:
16873  * if negative_step:
16874  */
16875  /*else*/ {
16876  __pyx_v_start = __pyx_v_shape;
16877  }
16878  __pyx_L14:;
16879 
16880  /* "View.MemoryView":842
16881  * if start < 0:
16882  * start = 0
16883  * elif start >= shape: # <<<<<<<<<<<<<<
16884  * if negative_step:
16885  * start = shape - 1
16886  */
16887  }
16888  __pyx_L12:;
16889 
16890  /* "View.MemoryView":837
16891  *
16892  *
16893  * if have_start: # <<<<<<<<<<<<<<
16894  * if start < 0:
16895  * start += shape
16896  */
16897  goto __pyx_L11;
16898  }
16899 
16900  /* "View.MemoryView":848
16901  * start = shape
16902  * else:
16903  * if negative_step: # <<<<<<<<<<<<<<
16904  * start = shape - 1
16905  * else:
16906  */
16907  /*else*/ {
16908  __pyx_t_2 = (__pyx_v_negative_step != 0);
16909  if (__pyx_t_2) {
16910 
16911  /* "View.MemoryView":849
16912  * else:
16913  * if negative_step:
16914  * start = shape - 1 # <<<<<<<<<<<<<<
16915  * else:
16916  * start = 0
16917  */
16918  __pyx_v_start = (__pyx_v_shape - 1);
16919 
16920  /* "View.MemoryView":848
16921  * start = shape
16922  * else:
16923  * if negative_step: # <<<<<<<<<<<<<<
16924  * start = shape - 1
16925  * else:
16926  */
16927  goto __pyx_L15;
16928  }
16929 
16930  /* "View.MemoryView":851
16931  * start = shape - 1
16932  * else:
16933  * start = 0 # <<<<<<<<<<<<<<
16934  *
16935  * if have_stop:
16936  */
16937  /*else*/ {
16938  __pyx_v_start = 0;
16939  }
16940  __pyx_L15:;
16941  }
16942  __pyx_L11:;
16943 
16944  /* "View.MemoryView":853
16945  * start = 0
16946  *
16947  * if have_stop: # <<<<<<<<<<<<<<
16948  * if stop < 0:
16949  * stop += shape
16950  */
16951  __pyx_t_2 = (__pyx_v_have_stop != 0);
16952  if (__pyx_t_2) {
16953 
16954  /* "View.MemoryView":854
16955  *
16956  * if have_stop:
16957  * if stop < 0: # <<<<<<<<<<<<<<
16958  * stop += shape
16959  * if stop < 0:
16960  */
16961  __pyx_t_2 = ((__pyx_v_stop < 0) != 0);
16962  if (__pyx_t_2) {
16963 
16964  /* "View.MemoryView":855
16965  * if have_stop:
16966  * if stop < 0:
16967  * stop += shape # <<<<<<<<<<<<<<
16968  * if stop < 0:
16969  * stop = 0
16970  */
16971  __pyx_v_stop = (__pyx_v_stop + __pyx_v_shape);
16972 
16973  /* "View.MemoryView":856
16974  * if stop < 0:
16975  * stop += shape
16976  * if stop < 0: # <<<<<<<<<<<<<<
16977  * stop = 0
16978  * elif stop > shape:
16979  */
16980  __pyx_t_2 = ((__pyx_v_stop < 0) != 0);
16981  if (__pyx_t_2) {
16982 
16983  /* "View.MemoryView":857
16984  * stop += shape
16985  * if stop < 0:
16986  * stop = 0 # <<<<<<<<<<<<<<
16987  * elif stop > shape:
16988  * stop = shape
16989  */
16990  __pyx_v_stop = 0;
16991 
16992  /* "View.MemoryView":856
16993  * if stop < 0:
16994  * stop += shape
16995  * if stop < 0: # <<<<<<<<<<<<<<
16996  * stop = 0
16997  * elif stop > shape:
16998  */
16999  }
17000 
17001  /* "View.MemoryView":854
17002  *
17003  * if have_stop:
17004  * if stop < 0: # <<<<<<<<<<<<<<
17005  * stop += shape
17006  * if stop < 0:
17007  */
17008  goto __pyx_L17;
17009  }
17010 
17011  /* "View.MemoryView":858
17012  * if stop < 0:
17013  * stop = 0
17014  * elif stop > shape: # <<<<<<<<<<<<<<
17015  * stop = shape
17016  * else:
17017  */
17018  __pyx_t_2 = ((__pyx_v_stop > __pyx_v_shape) != 0);
17019  if (__pyx_t_2) {
17020 
17021  /* "View.MemoryView":859
17022  * stop = 0
17023  * elif stop > shape:
17024  * stop = shape # <<<<<<<<<<<<<<
17025  * else:
17026  * if negative_step:
17027  */
17028  __pyx_v_stop = __pyx_v_shape;
17029 
17030  /* "View.MemoryView":858
17031  * if stop < 0:
17032  * stop = 0
17033  * elif stop > shape: # <<<<<<<<<<<<<<
17034  * stop = shape
17035  * else:
17036  */
17037  }
17038  __pyx_L17:;
17039 
17040  /* "View.MemoryView":853
17041  * start = 0
17042  *
17043  * if have_stop: # <<<<<<<<<<<<<<
17044  * if stop < 0:
17045  * stop += shape
17046  */
17047  goto __pyx_L16;
17048  }
17049 
17050  /* "View.MemoryView":861
17051  * stop = shape
17052  * else:
17053  * if negative_step: # <<<<<<<<<<<<<<
17054  * stop = -1
17055  * else:
17056  */
17057  /*else*/ {
17058  __pyx_t_2 = (__pyx_v_negative_step != 0);
17059  if (__pyx_t_2) {
17060 
17061  /* "View.MemoryView":862
17062  * else:
17063  * if negative_step:
17064  * stop = -1 # <<<<<<<<<<<<<<
17065  * else:
17066  * stop = shape
17067  */
17068  __pyx_v_stop = -1L;
17069 
17070  /* "View.MemoryView":861
17071  * stop = shape
17072  * else:
17073  * if negative_step: # <<<<<<<<<<<<<<
17074  * stop = -1
17075  * else:
17076  */
17077  goto __pyx_L19;
17078  }
17079 
17080  /* "View.MemoryView":864
17081  * stop = -1
17082  * else:
17083  * stop = shape # <<<<<<<<<<<<<<
17084  *
17085  * if not have_step:
17086  */
17087  /*else*/ {
17088  __pyx_v_stop = __pyx_v_shape;
17089  }
17090  __pyx_L19:;
17091  }
17092  __pyx_L16:;
17093 
17094  /* "View.MemoryView":866
17095  * stop = shape
17096  *
17097  * if not have_step: # <<<<<<<<<<<<<<
17098  * step = 1
17099  *
17100  */
17101  __pyx_t_2 = ((!(__pyx_v_have_step != 0)) != 0);
17102  if (__pyx_t_2) {
17103 
17104  /* "View.MemoryView":867
17105  *
17106  * if not have_step:
17107  * step = 1 # <<<<<<<<<<<<<<
17108  *
17109  *
17110  */
17111  __pyx_v_step = 1;
17112 
17113  /* "View.MemoryView":866
17114  * stop = shape
17115  *
17116  * if not have_step: # <<<<<<<<<<<<<<
17117  * step = 1
17118  *
17119  */
17120  }
17121 
17122  /* "View.MemoryView":871
17123  *
17124  * with cython.cdivision(True):
17125  * new_shape = (stop - start) // step # <<<<<<<<<<<<<<
17126  *
17127  * if (stop - start) - step * new_shape:
17128  */
17129  __pyx_v_new_shape = ((__pyx_v_stop - __pyx_v_start) / __pyx_v_step);
17130 
17131  /* "View.MemoryView":873
17132  * new_shape = (stop - start) // step
17133  *
17134  * if (stop - start) - step * new_shape: # <<<<<<<<<<<<<<
17135  * new_shape += 1
17136  *
17137  */
17138  __pyx_t_2 = (((__pyx_v_stop - __pyx_v_start) - (__pyx_v_step * __pyx_v_new_shape)) != 0);
17139  if (__pyx_t_2) {
17140 
17141  /* "View.MemoryView":874
17142  *
17143  * if (stop - start) - step * new_shape:
17144  * new_shape += 1 # <<<<<<<<<<<<<<
17145  *
17146  * if new_shape < 0:
17147  */
17148  __pyx_v_new_shape = (__pyx_v_new_shape + 1);
17149 
17150  /* "View.MemoryView":873
17151  * new_shape = (stop - start) // step
17152  *
17153  * if (stop - start) - step * new_shape: # <<<<<<<<<<<<<<
17154  * new_shape += 1
17155  *
17156  */
17157  }
17158 
17159  /* "View.MemoryView":876
17160  * new_shape += 1
17161  *
17162  * if new_shape < 0: # <<<<<<<<<<<<<<
17163  * new_shape = 0
17164  *
17165  */
17166  __pyx_t_2 = ((__pyx_v_new_shape < 0) != 0);
17167  if (__pyx_t_2) {
17168 
17169  /* "View.MemoryView":877
17170  *
17171  * if new_shape < 0:
17172  * new_shape = 0 # <<<<<<<<<<<<<<
17173  *
17174  *
17175  */
17176  __pyx_v_new_shape = 0;
17177 
17178  /* "View.MemoryView":876
17179  * new_shape += 1
17180  *
17181  * if new_shape < 0: # <<<<<<<<<<<<<<
17182  * new_shape = 0
17183  *
17184  */
17185  }
17186 
17187  /* "View.MemoryView":880
17188  *
17189  *
17190  * dst.strides[new_ndim] = stride * step # <<<<<<<<<<<<<<
17191  * dst.shape[new_ndim] = new_shape
17192  * dst.suboffsets[new_ndim] = suboffset
17193  */
17194  (__pyx_v_dst->strides[__pyx_v_new_ndim]) = (__pyx_v_stride * __pyx_v_step);
17195 
17196  /* "View.MemoryView":881
17197  *
17198  * dst.strides[new_ndim] = stride * step
17199  * dst.shape[new_ndim] = new_shape # <<<<<<<<<<<<<<
17200  * dst.suboffsets[new_ndim] = suboffset
17201  *
17202  */
17203  (__pyx_v_dst->shape[__pyx_v_new_ndim]) = __pyx_v_new_shape;
17204 
17205  /* "View.MemoryView":882
17206  * dst.strides[new_ndim] = stride * step
17207  * dst.shape[new_ndim] = new_shape
17208  * dst.suboffsets[new_ndim] = suboffset # <<<<<<<<<<<<<<
17209  *
17210  *
17211  */
17212  (__pyx_v_dst->suboffsets[__pyx_v_new_ndim]) = __pyx_v_suboffset;
17213  }
17214  __pyx_L3:;
17215 
17216  /* "View.MemoryView":885
17217  *
17218  *
17219  * if suboffset_dim[0] < 0: # <<<<<<<<<<<<<<
17220  * dst.data += start * stride
17221  * else:
17222  */
17223  __pyx_t_2 = (((__pyx_v_suboffset_dim[0]) < 0) != 0);
17224  if (__pyx_t_2) {
17225 
17226  /* "View.MemoryView":886
17227  *
17228  * if suboffset_dim[0] < 0:
17229  * dst.data += start * stride # <<<<<<<<<<<<<<
17230  * else:
17231  * dst.suboffsets[suboffset_dim[0]] += start * stride
17232  */
17233  __pyx_v_dst->data = (__pyx_v_dst->data + (__pyx_v_start * __pyx_v_stride));
17234 
17235  /* "View.MemoryView":885
17236  *
17237  *
17238  * if suboffset_dim[0] < 0: # <<<<<<<<<<<<<<
17239  * dst.data += start * stride
17240  * else:
17241  */
17242  goto __pyx_L23;
17243  }
17244 
17245  /* "View.MemoryView":888
17246  * dst.data += start * stride
17247  * else:
17248  * dst.suboffsets[suboffset_dim[0]] += start * stride # <<<<<<<<<<<<<<
17249  *
17250  * if suboffset >= 0:
17251  */
17252  /*else*/ {
17253  __pyx_t_3 = (__pyx_v_suboffset_dim[0]);
17254  (__pyx_v_dst->suboffsets[__pyx_t_3]) = ((__pyx_v_dst->suboffsets[__pyx_t_3]) + (__pyx_v_start * __pyx_v_stride));
17255  }
17256  __pyx_L23:;
17257 
17258  /* "View.MemoryView":890
17259  * dst.suboffsets[suboffset_dim[0]] += start * stride
17260  *
17261  * if suboffset >= 0: # <<<<<<<<<<<<<<
17262  * if not is_slice:
17263  * if new_ndim == 0:
17264  */
17265  __pyx_t_2 = ((__pyx_v_suboffset >= 0) != 0);
17266  if (__pyx_t_2) {
17267 
17268  /* "View.MemoryView":891
17269  *
17270  * if suboffset >= 0:
17271  * if not is_slice: # <<<<<<<<<<<<<<
17272  * if new_ndim == 0:
17273  * dst.data = (<char **> dst.data)[0] + suboffset
17274  */
17275  __pyx_t_2 = ((!(__pyx_v_is_slice != 0)) != 0);
17276  if (__pyx_t_2) {
17277 
17278  /* "View.MemoryView":892
17279  * if suboffset >= 0:
17280  * if not is_slice:
17281  * if new_ndim == 0: # <<<<<<<<<<<<<<
17282  * dst.data = (<char **> dst.data)[0] + suboffset
17283  * else:
17284  */
17285  __pyx_t_2 = ((__pyx_v_new_ndim == 0) != 0);
17286  if (__pyx_t_2) {
17287 
17288  /* "View.MemoryView":893
17289  * if not is_slice:
17290  * if new_ndim == 0:
17291  * dst.data = (<char **> dst.data)[0] + suboffset # <<<<<<<<<<<<<<
17292  * else:
17293  * _err_dim(IndexError, "All dimensions preceding dimension %d "
17294  */
17295  __pyx_v_dst->data = ((((char **)__pyx_v_dst->data)[0]) + __pyx_v_suboffset);
17296 
17297  /* "View.MemoryView":892
17298  * if suboffset >= 0:
17299  * if not is_slice:
17300  * if new_ndim == 0: # <<<<<<<<<<<<<<
17301  * dst.data = (<char **> dst.data)[0] + suboffset
17302  * else:
17303  */
17304  goto __pyx_L26;
17305  }
17306 
17307  /* "View.MemoryView":895
17308  * dst.data = (<char **> dst.data)[0] + suboffset
17309  * else:
17310  * _err_dim(IndexError, "All dimensions preceding dimension %d " # <<<<<<<<<<<<<<
17311  * "must be indexed and not sliced", dim)
17312  * else:
17313  */
17314  /*else*/ {
17315 
17316  /* "View.MemoryView":896
17317  * else:
17318  * _err_dim(IndexError, "All dimensions preceding dimension %d "
17319  * "must be indexed and not sliced", dim) # <<<<<<<<<<<<<<
17320  * else:
17321  * suboffset_dim[0] = new_ndim
17322  */
17323  __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_IndexError, ((char *)"All dimensions preceding dimension %d must be indexed and not sliced"), __pyx_v_dim); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(2, 895, __pyx_L1_error)
17324  }
17325  __pyx_L26:;
17326 
17327  /* "View.MemoryView":891
17328  *
17329  * if suboffset >= 0:
17330  * if not is_slice: # <<<<<<<<<<<<<<
17331  * if new_ndim == 0:
17332  * dst.data = (<char **> dst.data)[0] + suboffset
17333  */
17334  goto __pyx_L25;
17335  }
17336 
17337  /* "View.MemoryView":898
17338  * "must be indexed and not sliced", dim)
17339  * else:
17340  * suboffset_dim[0] = new_ndim # <<<<<<<<<<<<<<
17341  *
17342  * return 0
17343  */
17344  /*else*/ {
17345  (__pyx_v_suboffset_dim[0]) = __pyx_v_new_ndim;
17346  }
17347  __pyx_L25:;
17348 
17349  /* "View.MemoryView":890
17350  * dst.suboffsets[suboffset_dim[0]] += start * stride
17351  *
17352  * if suboffset >= 0: # <<<<<<<<<<<<<<
17353  * if not is_slice:
17354  * if new_ndim == 0:
17355  */
17356  }
17357 
17358  /* "View.MemoryView":900
17359  * suboffset_dim[0] = new_ndim
17360  *
17361  * return 0 # <<<<<<<<<<<<<<
17362  *
17363  *
17364  */
17365  __pyx_r = 0;
17366  goto __pyx_L0;
17367 
17368  /* "View.MemoryView":803
17369  *
17370  * @cname('__pyx_memoryview_slice_memviewslice')
17371  * cdef int slice_memviewslice( # <<<<<<<<<<<<<<
17372  * __Pyx_memviewslice *dst,
17373  * Py_ssize_t shape, Py_ssize_t stride, Py_ssize_t suboffset,
17374  */
17375 
17376  /* function exit code */
17377  __pyx_L1_error:;
17378  {
17379  #ifdef WITH_THREAD
17380  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
17381  #endif
17382  __Pyx_AddTraceback("View.MemoryView.slice_memviewslice", __pyx_clineno, __pyx_lineno, __pyx_filename);
17383  #ifdef WITH_THREAD
17384  __Pyx_PyGILState_Release(__pyx_gilstate_save);
17385  #endif
17386  }
17387  __pyx_r = -1;
17388  __pyx_L0:;
17389  return __pyx_r;
17390 }
17391 
17392 /* "View.MemoryView":906
17393  *
17394  * @cname('__pyx_pybuffer_index')
17395  * cdef char *pybuffer_index(Py_buffer *view, char *bufp, Py_ssize_t index, # <<<<<<<<<<<<<<
17396  * Py_ssize_t dim) except NULL:
17397  * cdef Py_ssize_t shape, stride, suboffset = -1
17398  */
17399 
17400 static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, Py_ssize_t __pyx_v_index, Py_ssize_t __pyx_v_dim) {
17401  Py_ssize_t __pyx_v_shape;
17402  Py_ssize_t __pyx_v_stride;
17403  Py_ssize_t __pyx_v_suboffset;
17404  Py_ssize_t __pyx_v_itemsize;
17405  char *__pyx_v_resultp;
17406  char *__pyx_r;
17407  __Pyx_RefNannyDeclarations
17408  Py_ssize_t __pyx_t_1;
17409  int __pyx_t_2;
17410  PyObject *__pyx_t_3 = NULL;
17411  PyObject *__pyx_t_4 = NULL;
17412  __Pyx_RefNannySetupContext("pybuffer_index", 0);
17413 
17414  /* "View.MemoryView":908
17415  * cdef char *pybuffer_index(Py_buffer *view, char *bufp, Py_ssize_t index,
17416  * Py_ssize_t dim) except NULL:
17417  * cdef Py_ssize_t shape, stride, suboffset = -1 # <<<<<<<<<<<<<<
17418  * cdef Py_ssize_t itemsize = view.itemsize
17419  * cdef char *resultp
17420  */
17421  __pyx_v_suboffset = -1L;
17422 
17423  /* "View.MemoryView":909
17424  * Py_ssize_t dim) except NULL:
17425  * cdef Py_ssize_t shape, stride, suboffset = -1
17426  * cdef Py_ssize_t itemsize = view.itemsize # <<<<<<<<<<<<<<
17427  * cdef char *resultp
17428  *
17429  */
17430  __pyx_t_1 = __pyx_v_view->itemsize;
17431  __pyx_v_itemsize = __pyx_t_1;
17432 
17433  /* "View.MemoryView":912
17434  * cdef char *resultp
17435  *
17436  * if view.ndim == 0: # <<<<<<<<<<<<<<
17437  * shape = view.len / itemsize
17438  * stride = itemsize
17439  */
17440  __pyx_t_2 = ((__pyx_v_view->ndim == 0) != 0);
17441  if (__pyx_t_2) {
17442 
17443  /* "View.MemoryView":913
17444  *
17445  * if view.ndim == 0:
17446  * shape = view.len / itemsize # <<<<<<<<<<<<<<
17447  * stride = itemsize
17448  * else:
17449  */
17450  if (unlikely(__pyx_v_itemsize == 0)) {
17451  PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero");
17452  __PYX_ERR(2, 913, __pyx_L1_error)
17453  }
17454  else if (sizeof(Py_ssize_t) == sizeof(long) && (!(((Py_ssize_t)-1) > 0)) && unlikely(__pyx_v_itemsize == (Py_ssize_t)-1) && unlikely(UNARY_NEG_WOULD_OVERFLOW(__pyx_v_view->len))) {
17455  PyErr_SetString(PyExc_OverflowError, "value too large to perform division");
17456  __PYX_ERR(2, 913, __pyx_L1_error)
17457  }
17458  __pyx_v_shape = __Pyx_div_Py_ssize_t(__pyx_v_view->len, __pyx_v_itemsize);
17459 
17460  /* "View.MemoryView":914
17461  * if view.ndim == 0:
17462  * shape = view.len / itemsize
17463  * stride = itemsize # <<<<<<<<<<<<<<
17464  * else:
17465  * shape = view.shape[dim]
17466  */
17467  __pyx_v_stride = __pyx_v_itemsize;
17468 
17469  /* "View.MemoryView":912
17470  * cdef char *resultp
17471  *
17472  * if view.ndim == 0: # <<<<<<<<<<<<<<
17473  * shape = view.len / itemsize
17474  * stride = itemsize
17475  */
17476  goto __pyx_L3;
17477  }
17478 
17479  /* "View.MemoryView":916
17480  * stride = itemsize
17481  * else:
17482  * shape = view.shape[dim] # <<<<<<<<<<<<<<
17483  * stride = view.strides[dim]
17484  * if view.suboffsets != NULL:
17485  */
17486  /*else*/ {
17487  __pyx_v_shape = (__pyx_v_view->shape[__pyx_v_dim]);
17488 
17489  /* "View.MemoryView":917
17490  * else:
17491  * shape = view.shape[dim]
17492  * stride = view.strides[dim] # <<<<<<<<<<<<<<
17493  * if view.suboffsets != NULL:
17494  * suboffset = view.suboffsets[dim]
17495  */
17496  __pyx_v_stride = (__pyx_v_view->strides[__pyx_v_dim]);
17497 
17498  /* "View.MemoryView":918
17499  * shape = view.shape[dim]
17500  * stride = view.strides[dim]
17501  * if view.suboffsets != NULL: # <<<<<<<<<<<<<<
17502  * suboffset = view.suboffsets[dim]
17503  *
17504  */
17505  __pyx_t_2 = ((__pyx_v_view->suboffsets != NULL) != 0);
17506  if (__pyx_t_2) {
17507 
17508  /* "View.MemoryView":919
17509  * stride = view.strides[dim]
17510  * if view.suboffsets != NULL:
17511  * suboffset = view.suboffsets[dim] # <<<<<<<<<<<<<<
17512  *
17513  * if index < 0:
17514  */
17515  __pyx_v_suboffset = (__pyx_v_view->suboffsets[__pyx_v_dim]);
17516 
17517  /* "View.MemoryView":918
17518  * shape = view.shape[dim]
17519  * stride = view.strides[dim]
17520  * if view.suboffsets != NULL: # <<<<<<<<<<<<<<
17521  * suboffset = view.suboffsets[dim]
17522  *
17523  */
17524  }
17525  }
17526  __pyx_L3:;
17527 
17528  /* "View.MemoryView":921
17529  * suboffset = view.suboffsets[dim]
17530  *
17531  * if index < 0: # <<<<<<<<<<<<<<
17532  * index += view.shape[dim]
17533  * if index < 0:
17534  */
17535  __pyx_t_2 = ((__pyx_v_index < 0) != 0);
17536  if (__pyx_t_2) {
17537 
17538  /* "View.MemoryView":922
17539  *
17540  * if index < 0:
17541  * index += view.shape[dim] # <<<<<<<<<<<<<<
17542  * if index < 0:
17543  * raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
17544  */
17545  __pyx_v_index = (__pyx_v_index + (__pyx_v_view->shape[__pyx_v_dim]));
17546 
17547  /* "View.MemoryView":923
17548  * if index < 0:
17549  * index += view.shape[dim]
17550  * if index < 0: # <<<<<<<<<<<<<<
17551  * raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
17552  *
17553  */
17554  __pyx_t_2 = ((__pyx_v_index < 0) != 0);
17555  if (unlikely(__pyx_t_2)) {
17556 
17557  /* "View.MemoryView":924
17558  * index += view.shape[dim]
17559  * if index < 0:
17560  * raise IndexError("Out of bounds on buffer access (axis %d)" % dim) # <<<<<<<<<<<<<<
17561  *
17562  * if index >= shape:
17563  */
17564  __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 924, __pyx_L1_error)
17565  __Pyx_GOTREF(__pyx_t_3);
17566  __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Out_of_bounds_on_buffer_access_a, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 924, __pyx_L1_error)
17567  __Pyx_GOTREF(__pyx_t_4);
17568  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17569  __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_IndexError, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 924, __pyx_L1_error)
17570  __Pyx_GOTREF(__pyx_t_3);
17571  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
17572  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
17573  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17574  __PYX_ERR(2, 924, __pyx_L1_error)
17575 
17576  /* "View.MemoryView":923
17577  * if index < 0:
17578  * index += view.shape[dim]
17579  * if index < 0: # <<<<<<<<<<<<<<
17580  * raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
17581  *
17582  */
17583  }
17584 
17585  /* "View.MemoryView":921
17586  * suboffset = view.suboffsets[dim]
17587  *
17588  * if index < 0: # <<<<<<<<<<<<<<
17589  * index += view.shape[dim]
17590  * if index < 0:
17591  */
17592  }
17593 
17594  /* "View.MemoryView":926
17595  * raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
17596  *
17597  * if index >= shape: # <<<<<<<<<<<<<<
17598  * raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
17599  *
17600  */
17601  __pyx_t_2 = ((__pyx_v_index >= __pyx_v_shape) != 0);
17602  if (unlikely(__pyx_t_2)) {
17603 
17604  /* "View.MemoryView":927
17605  *
17606  * if index >= shape:
17607  * raise IndexError("Out of bounds on buffer access (axis %d)" % dim) # <<<<<<<<<<<<<<
17608  *
17609  * resultp = bufp + index * stride
17610  */
17611  __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 927, __pyx_L1_error)
17612  __Pyx_GOTREF(__pyx_t_3);
17613  __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Out_of_bounds_on_buffer_access_a, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 927, __pyx_L1_error)
17614  __Pyx_GOTREF(__pyx_t_4);
17615  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17616  __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_IndexError, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 927, __pyx_L1_error)
17617  __Pyx_GOTREF(__pyx_t_3);
17618  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
17619  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
17620  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17621  __PYX_ERR(2, 927, __pyx_L1_error)
17622 
17623  /* "View.MemoryView":926
17624  * raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
17625  *
17626  * if index >= shape: # <<<<<<<<<<<<<<
17627  * raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
17628  *
17629  */
17630  }
17631 
17632  /* "View.MemoryView":929
17633  * raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
17634  *
17635  * resultp = bufp + index * stride # <<<<<<<<<<<<<<
17636  * if suboffset >= 0:
17637  * resultp = (<char **> resultp)[0] + suboffset
17638  */
17639  __pyx_v_resultp = (__pyx_v_bufp + (__pyx_v_index * __pyx_v_stride));
17640 
17641  /* "View.MemoryView":930
17642  *
17643  * resultp = bufp + index * stride
17644  * if suboffset >= 0: # <<<<<<<<<<<<<<
17645  * resultp = (<char **> resultp)[0] + suboffset
17646  *
17647  */
17648  __pyx_t_2 = ((__pyx_v_suboffset >= 0) != 0);
17649  if (__pyx_t_2) {
17650 
17651  /* "View.MemoryView":931
17652  * resultp = bufp + index * stride
17653  * if suboffset >= 0:
17654  * resultp = (<char **> resultp)[0] + suboffset # <<<<<<<<<<<<<<
17655  *
17656  * return resultp
17657  */
17658  __pyx_v_resultp = ((((char **)__pyx_v_resultp)[0]) + __pyx_v_suboffset);
17659 
17660  /* "View.MemoryView":930
17661  *
17662  * resultp = bufp + index * stride
17663  * if suboffset >= 0: # <<<<<<<<<<<<<<
17664  * resultp = (<char **> resultp)[0] + suboffset
17665  *
17666  */
17667  }
17668 
17669  /* "View.MemoryView":933
17670  * resultp = (<char **> resultp)[0] + suboffset
17671  *
17672  * return resultp # <<<<<<<<<<<<<<
17673  *
17674  *
17675  */
17676  __pyx_r = __pyx_v_resultp;
17677  goto __pyx_L0;
17678 
17679  /* "View.MemoryView":906
17680  *
17681  * @cname('__pyx_pybuffer_index')
17682  * cdef char *pybuffer_index(Py_buffer *view, char *bufp, Py_ssize_t index, # <<<<<<<<<<<<<<
17683  * Py_ssize_t dim) except NULL:
17684  * cdef Py_ssize_t shape, stride, suboffset = -1
17685  */
17686 
17687  /* function exit code */
17688  __pyx_L1_error:;
17689  __Pyx_XDECREF(__pyx_t_3);
17690  __Pyx_XDECREF(__pyx_t_4);
17691  __Pyx_AddTraceback("View.MemoryView.pybuffer_index", __pyx_clineno, __pyx_lineno, __pyx_filename);
17692  __pyx_r = NULL;
17693  __pyx_L0:;
17694  __Pyx_RefNannyFinishContext();
17695  return __pyx_r;
17696 }
17697 
17698 /* "View.MemoryView":939
17699  *
17700  * @cname('__pyx_memslice_transpose')
17701  * cdef int transpose_memslice(__Pyx_memviewslice *memslice) nogil except 0: # <<<<<<<<<<<<<<
17702  * cdef int ndim = memslice.memview.view.ndim
17703  *
17704  */
17705 
17706 static int __pyx_memslice_transpose(__Pyx_memviewslice *__pyx_v_memslice) {
17707  int __pyx_v_ndim;
17708  Py_ssize_t *__pyx_v_shape;
17709  Py_ssize_t *__pyx_v_strides;
17710  int __pyx_v_i;
17711  int __pyx_v_j;
17712  int __pyx_r;
17713  int __pyx_t_1;
17714  Py_ssize_t *__pyx_t_2;
17715  long __pyx_t_3;
17716  long __pyx_t_4;
17717  Py_ssize_t __pyx_t_5;
17718  Py_ssize_t __pyx_t_6;
17719  int __pyx_t_7;
17720  int __pyx_t_8;
17721  int __pyx_t_9;
17722 
17723  /* "View.MemoryView":940
17724  * @cname('__pyx_memslice_transpose')
17725  * cdef int transpose_memslice(__Pyx_memviewslice *memslice) nogil except 0:
17726  * cdef int ndim = memslice.memview.view.ndim # <<<<<<<<<<<<<<
17727  *
17728  * cdef Py_ssize_t *shape = memslice.shape
17729  */
17730  __pyx_t_1 = __pyx_v_memslice->memview->view.ndim;
17731  __pyx_v_ndim = __pyx_t_1;
17732 
17733  /* "View.MemoryView":942
17734  * cdef int ndim = memslice.memview.view.ndim
17735  *
17736  * cdef Py_ssize_t *shape = memslice.shape # <<<<<<<<<<<<<<
17737  * cdef Py_ssize_t *strides = memslice.strides
17738  *
17739  */
17740  __pyx_t_2 = __pyx_v_memslice->shape;
17741  __pyx_v_shape = __pyx_t_2;
17742 
17743  /* "View.MemoryView":943
17744  *
17745  * cdef Py_ssize_t *shape = memslice.shape
17746  * cdef Py_ssize_t *strides = memslice.strides # <<<<<<<<<<<<<<
17747  *
17748  *
17749  */
17750  __pyx_t_2 = __pyx_v_memslice->strides;
17751  __pyx_v_strides = __pyx_t_2;
17752 
17753  /* "View.MemoryView":947
17754  *
17755  * cdef int i, j
17756  * for i in range(ndim / 2): # <<<<<<<<<<<<<<
17757  * j = ndim - 1 - i
17758  * strides[i], strides[j] = strides[j], strides[i]
17759  */
17760  __pyx_t_3 = __Pyx_div_long(__pyx_v_ndim, 2);
17761  __pyx_t_4 = __pyx_t_3;
17762  for (__pyx_t_1 = 0; __pyx_t_1 < __pyx_t_4; __pyx_t_1+=1) {
17763  __pyx_v_i = __pyx_t_1;
17764 
17765  /* "View.MemoryView":948
17766  * cdef int i, j
17767  * for i in range(ndim / 2):
17768  * j = ndim - 1 - i # <<<<<<<<<<<<<<
17769  * strides[i], strides[j] = strides[j], strides[i]
17770  * shape[i], shape[j] = shape[j], shape[i]
17771  */
17772  __pyx_v_j = ((__pyx_v_ndim - 1) - __pyx_v_i);
17773 
17774  /* "View.MemoryView":949
17775  * for i in range(ndim / 2):
17776  * j = ndim - 1 - i
17777  * strides[i], strides[j] = strides[j], strides[i] # <<<<<<<<<<<<<<
17778  * shape[i], shape[j] = shape[j], shape[i]
17779  *
17780  */
17781  __pyx_t_5 = (__pyx_v_strides[__pyx_v_j]);
17782  __pyx_t_6 = (__pyx_v_strides[__pyx_v_i]);
17783  (__pyx_v_strides[__pyx_v_i]) = __pyx_t_5;
17784  (__pyx_v_strides[__pyx_v_j]) = __pyx_t_6;
17785 
17786  /* "View.MemoryView":950
17787  * j = ndim - 1 - i
17788  * strides[i], strides[j] = strides[j], strides[i]
17789  * shape[i], shape[j] = shape[j], shape[i] # <<<<<<<<<<<<<<
17790  *
17791  * if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0:
17792  */
17793  __pyx_t_6 = (__pyx_v_shape[__pyx_v_j]);
17794  __pyx_t_5 = (__pyx_v_shape[__pyx_v_i]);
17795  (__pyx_v_shape[__pyx_v_i]) = __pyx_t_6;
17796  (__pyx_v_shape[__pyx_v_j]) = __pyx_t_5;
17797 
17798  /* "View.MemoryView":952
17799  * shape[i], shape[j] = shape[j], shape[i]
17800  *
17801  * if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0: # <<<<<<<<<<<<<<
17802  * _err(ValueError, "Cannot transpose memoryview with indirect dimensions")
17803  *
17804  */
17805  __pyx_t_8 = (((__pyx_v_memslice->suboffsets[__pyx_v_i]) >= 0) != 0);
17806  if (!__pyx_t_8) {
17807  } else {
17808  __pyx_t_7 = __pyx_t_8;
17809  goto __pyx_L6_bool_binop_done;
17810  }
17811  __pyx_t_8 = (((__pyx_v_memslice->suboffsets[__pyx_v_j]) >= 0) != 0);
17812  __pyx_t_7 = __pyx_t_8;
17813  __pyx_L6_bool_binop_done:;
17814  if (__pyx_t_7) {
17815 
17816  /* "View.MemoryView":953
17817  *
17818  * if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0:
17819  * _err(ValueError, "Cannot transpose memoryview with indirect dimensions") # <<<<<<<<<<<<<<
17820  *
17821  * return 1
17822  */
17823  __pyx_t_9 = __pyx_memoryview_err(__pyx_builtin_ValueError, ((char *)"Cannot transpose memoryview with indirect dimensions")); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(2, 953, __pyx_L1_error)
17824 
17825  /* "View.MemoryView":952
17826  * shape[i], shape[j] = shape[j], shape[i]
17827  *
17828  * if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0: # <<<<<<<<<<<<<<
17829  * _err(ValueError, "Cannot transpose memoryview with indirect dimensions")
17830  *
17831  */
17832  }
17833  }
17834 
17835  /* "View.MemoryView":955
17836  * _err(ValueError, "Cannot transpose memoryview with indirect dimensions")
17837  *
17838  * return 1 # <<<<<<<<<<<<<<
17839  *
17840  *
17841  */
17842  __pyx_r = 1;
17843  goto __pyx_L0;
17844 
17845  /* "View.MemoryView":939
17846  *
17847  * @cname('__pyx_memslice_transpose')
17848  * cdef int transpose_memslice(__Pyx_memviewslice *memslice) nogil except 0: # <<<<<<<<<<<<<<
17849  * cdef int ndim = memslice.memview.view.ndim
17850  *
17851  */
17852 
17853  /* function exit code */
17854  __pyx_L1_error:;
17855  {
17856  #ifdef WITH_THREAD
17857  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
17858  #endif
17859  __Pyx_AddTraceback("View.MemoryView.transpose_memslice", __pyx_clineno, __pyx_lineno, __pyx_filename);
17860  #ifdef WITH_THREAD
17861  __Pyx_PyGILState_Release(__pyx_gilstate_save);
17862  #endif
17863  }
17864  __pyx_r = 0;
17865  __pyx_L0:;
17866  return __pyx_r;
17867 }
17868 
17869 /* "View.MemoryView":972
17870  * cdef int (*to_dtype_func)(char *, object) except 0
17871  *
17872  * def __dealloc__(self): # <<<<<<<<<<<<<<
17873  * __PYX_XDEC_MEMVIEW(&self.from_slice, 1)
17874  *
17875  */
17876 
17877 /* Python wrapper */
17878 static void __pyx_memoryviewslice___dealloc__(PyObject *__pyx_v_self); /*proto*/
17879 static void __pyx_memoryviewslice___dealloc__(PyObject *__pyx_v_self) {
17880  __Pyx_RefNannyDeclarations
17881  __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
17882  __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(((struct __pyx_memoryviewslice_obj *)__pyx_v_self));
17883 
17884  /* function exit code */
17885  __Pyx_RefNannyFinishContext();
17886 }
17887 
17888 static void __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(struct __pyx_memoryviewslice_obj *__pyx_v_self) {
17889  __Pyx_RefNannyDeclarations
17890  __Pyx_RefNannySetupContext("__dealloc__", 0);
17891 
17892  /* "View.MemoryView":973
17893  *
17894  * def __dealloc__(self):
17895  * __PYX_XDEC_MEMVIEW(&self.from_slice, 1) # <<<<<<<<<<<<<<
17896  *
17897  * cdef convert_item_to_object(self, char *itemp):
17898  */
17899  __PYX_XDEC_MEMVIEW((&__pyx_v_self->from_slice), 1);
17900 
17901  /* "View.MemoryView":972
17902  * cdef int (*to_dtype_func)(char *, object) except 0
17903  *
17904  * def __dealloc__(self): # <<<<<<<<<<<<<<
17905  * __PYX_XDEC_MEMVIEW(&self.from_slice, 1)
17906  *
17907  */
17908 
17909  /* function exit code */
17910  __Pyx_RefNannyFinishContext();
17911 }
17912 
17913 /* "View.MemoryView":975
17914  * __PYX_XDEC_MEMVIEW(&self.from_slice, 1)
17915  *
17916  * cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<<
17917  * if self.to_object_func != NULL:
17918  * return self.to_object_func(itemp)
17919  */
17920 
17921 static PyObject *__pyx_memoryviewslice_convert_item_to_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp) {
17922  PyObject *__pyx_r = NULL;
17923  __Pyx_RefNannyDeclarations
17924  int __pyx_t_1;
17925  PyObject *__pyx_t_2 = NULL;
17926  __Pyx_RefNannySetupContext("convert_item_to_object", 0);
17927 
17928  /* "View.MemoryView":976
17929  *
17930  * cdef convert_item_to_object(self, char *itemp):
17931  * if self.to_object_func != NULL: # <<<<<<<<<<<<<<
17932  * return self.to_object_func(itemp)
17933  * else:
17934  */
17935  __pyx_t_1 = ((__pyx_v_self->to_object_func != NULL) != 0);
17936  if (__pyx_t_1) {
17937 
17938  /* "View.MemoryView":977
17939  * cdef convert_item_to_object(self, char *itemp):
17940  * if self.to_object_func != NULL:
17941  * return self.to_object_func(itemp) # <<<<<<<<<<<<<<
17942  * else:
17943  * return memoryview.convert_item_to_object(self, itemp)
17944  */
17945  __Pyx_XDECREF(__pyx_r);
17946  __pyx_t_2 = __pyx_v_self->to_object_func(__pyx_v_itemp); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 977, __pyx_L1_error)
17947  __Pyx_GOTREF(__pyx_t_2);
17948  __pyx_r = __pyx_t_2;
17949  __pyx_t_2 = 0;
17950  goto __pyx_L0;
17951 
17952  /* "View.MemoryView":976
17953  *
17954  * cdef convert_item_to_object(self, char *itemp):
17955  * if self.to_object_func != NULL: # <<<<<<<<<<<<<<
17956  * return self.to_object_func(itemp)
17957  * else:
17958  */
17959  }
17960 
17961  /* "View.MemoryView":979
17962  * return self.to_object_func(itemp)
17963  * else:
17964  * return memoryview.convert_item_to_object(self, itemp) # <<<<<<<<<<<<<<
17965  *
17966  * cdef assign_item_from_object(self, char *itemp, object value):
17967  */
17968  /*else*/ {
17969  __Pyx_XDECREF(__pyx_r);
17970  __pyx_t_2 = __pyx_memoryview_convert_item_to_object(((struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_itemp); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 979, __pyx_L1_error)
17971  __Pyx_GOTREF(__pyx_t_2);
17972  __pyx_r = __pyx_t_2;
17973  __pyx_t_2 = 0;
17974  goto __pyx_L0;
17975  }
17976 
17977  /* "View.MemoryView":975
17978  * __PYX_XDEC_MEMVIEW(&self.from_slice, 1)
17979  *
17980  * cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<<
17981  * if self.to_object_func != NULL:
17982  * return self.to_object_func(itemp)
17983  */
17984 
17985  /* function exit code */
17986  __pyx_L1_error:;
17987  __Pyx_XDECREF(__pyx_t_2);
17988  __Pyx_AddTraceback("View.MemoryView._memoryviewslice.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
17989  __pyx_r = 0;
17990  __pyx_L0:;
17991  __Pyx_XGIVEREF(__pyx_r);
17992  __Pyx_RefNannyFinishContext();
17993  return __pyx_r;
17994 }
17995 
17996 /* "View.MemoryView":981
17997  * return memoryview.convert_item_to_object(self, itemp)
17998  *
17999  * cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<<
18000  * if self.to_dtype_func != NULL:
18001  * self.to_dtype_func(itemp, value)
18002  */
18003 
18004 static PyObject *__pyx_memoryviewslice_assign_item_from_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value) {
18005  PyObject *__pyx_r = NULL;
18006  __Pyx_RefNannyDeclarations
18007  int __pyx_t_1;
18008  int __pyx_t_2;
18009  PyObject *__pyx_t_3 = NULL;
18010  __Pyx_RefNannySetupContext("assign_item_from_object", 0);
18011 
18012  /* "View.MemoryView":982
18013  *
18014  * cdef assign_item_from_object(self, char *itemp, object value):
18015  * if self.to_dtype_func != NULL: # <<<<<<<<<<<<<<
18016  * self.to_dtype_func(itemp, value)
18017  * else:
18018  */
18019  __pyx_t_1 = ((__pyx_v_self->to_dtype_func != NULL) != 0);
18020  if (__pyx_t_1) {
18021 
18022  /* "View.MemoryView":983
18023  * cdef assign_item_from_object(self, char *itemp, object value):
18024  * if self.to_dtype_func != NULL:
18025  * self.to_dtype_func(itemp, value) # <<<<<<<<<<<<<<
18026  * else:
18027  * memoryview.assign_item_from_object(self, itemp, value)
18028  */
18029  __pyx_t_2 = __pyx_v_self->to_dtype_func(__pyx_v_itemp, __pyx_v_value); if (unlikely(__pyx_t_2 == ((int)0))) __PYX_ERR(2, 983, __pyx_L1_error)
18030 
18031  /* "View.MemoryView":982
18032  *
18033  * cdef assign_item_from_object(self, char *itemp, object value):
18034  * if self.to_dtype_func != NULL: # <<<<<<<<<<<<<<
18035  * self.to_dtype_func(itemp, value)
18036  * else:
18037  */
18038  goto __pyx_L3;
18039  }
18040 
18041  /* "View.MemoryView":985
18042  * self.to_dtype_func(itemp, value)
18043  * else:
18044  * memoryview.assign_item_from_object(self, itemp, value) # <<<<<<<<<<<<<<
18045  *
18046  * @property
18047  */
18048  /*else*/ {
18049  __pyx_t_3 = __pyx_memoryview_assign_item_from_object(((struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_itemp, __pyx_v_value); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 985, __pyx_L1_error)
18050  __Pyx_GOTREF(__pyx_t_3);
18051  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
18052  }
18053  __pyx_L3:;
18054 
18055  /* "View.MemoryView":981
18056  * return memoryview.convert_item_to_object(self, itemp)
18057  *
18058  * cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<<
18059  * if self.to_dtype_func != NULL:
18060  * self.to_dtype_func(itemp, value)
18061  */
18062 
18063  /* function exit code */
18064  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
18065  goto __pyx_L0;
18066  __pyx_L1_error:;
18067  __Pyx_XDECREF(__pyx_t_3);
18068  __Pyx_AddTraceback("View.MemoryView._memoryviewslice.assign_item_from_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
18069  __pyx_r = 0;
18070  __pyx_L0:;
18071  __Pyx_XGIVEREF(__pyx_r);
18072  __Pyx_RefNannyFinishContext();
18073  return __pyx_r;
18074 }
18075 
18076 /* "View.MemoryView":988
18077  *
18078  * @property
18079  * def base(self): # <<<<<<<<<<<<<<
18080  * return self.from_object
18081  *
18082  */
18083 
18084 /* Python wrapper */
18085 static PyObject *__pyx_pw_15View_dot_MemoryView_16_memoryviewslice_4base_1__get__(PyObject *__pyx_v_self); /*proto*/
18086 static PyObject *__pyx_pw_15View_dot_MemoryView_16_memoryviewslice_4base_1__get__(PyObject *__pyx_v_self) {
18087  PyObject *__pyx_r = 0;
18088  __Pyx_RefNannyDeclarations
18089  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
18090  __pyx_r = __pyx_pf_15View_dot_MemoryView_16_memoryviewslice_4base___get__(((struct __pyx_memoryviewslice_obj *)__pyx_v_self));
18091 
18092  /* function exit code */
18093  __Pyx_RefNannyFinishContext();
18094  return __pyx_r;
18095 }
18096 
18097 static PyObject *__pyx_pf_15View_dot_MemoryView_16_memoryviewslice_4base___get__(struct __pyx_memoryviewslice_obj *__pyx_v_self) {
18098  PyObject *__pyx_r = NULL;
18099  __Pyx_RefNannyDeclarations
18100  __Pyx_RefNannySetupContext("__get__", 0);
18101 
18102  /* "View.MemoryView":989
18103  * @property
18104  * def base(self):
18105  * return self.from_object # <<<<<<<<<<<<<<
18106  *
18107  * __pyx_getbuffer = capsule(<void *> &__pyx_memoryview_getbuffer, "getbuffer(obj, view, flags)")
18108  */
18109  __Pyx_XDECREF(__pyx_r);
18110  __Pyx_INCREF(__pyx_v_self->from_object);
18111  __pyx_r = __pyx_v_self->from_object;
18112  goto __pyx_L0;
18113 
18114  /* "View.MemoryView":988
18115  *
18116  * @property
18117  * def base(self): # <<<<<<<<<<<<<<
18118  * return self.from_object
18119  *
18120  */
18121 
18122  /* function exit code */
18123  __pyx_L0:;
18124  __Pyx_XGIVEREF(__pyx_r);
18125  __Pyx_RefNannyFinishContext();
18126  return __pyx_r;
18127 }
18128 
18129 /* "(tree fragment)":1
18130  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
18131  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
18132  * def __setstate_cython__(self, __pyx_state):
18133  */
18134 
18135 /* Python wrapper */
18136 static PyObject *__pyx_pw___pyx_memoryviewslice_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
18137 static PyObject *__pyx_pw___pyx_memoryviewslice_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
18138  PyObject *__pyx_r = 0;
18139  __Pyx_RefNannyDeclarations
18140  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
18141  __pyx_r = __pyx_pf___pyx_memoryviewslice___reduce_cython__(((struct __pyx_memoryviewslice_obj *)__pyx_v_self));
18142 
18143  /* function exit code */
18144  __Pyx_RefNannyFinishContext();
18145  return __pyx_r;
18146 }
18147 
18148 static PyObject *__pyx_pf___pyx_memoryviewslice___reduce_cython__(CYTHON_UNUSED struct __pyx_memoryviewslice_obj *__pyx_v_self) {
18149  PyObject *__pyx_r = NULL;
18150  __Pyx_RefNannyDeclarations
18151  PyObject *__pyx_t_1 = NULL;
18152  __Pyx_RefNannySetupContext("__reduce_cython__", 0);
18153 
18154  /* "(tree fragment)":2
18155  * def __reduce_cython__(self):
18156  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
18157  * def __setstate_cython__(self, __pyx_state):
18158  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
18159  */
18160  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__24, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 2, __pyx_L1_error)
18161  __Pyx_GOTREF(__pyx_t_1);
18162  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
18163  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
18164  __PYX_ERR(2, 2, __pyx_L1_error)
18165 
18166  /* "(tree fragment)":1
18167  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
18168  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
18169  * def __setstate_cython__(self, __pyx_state):
18170  */
18171 
18172  /* function exit code */
18173  __pyx_L1_error:;
18174  __Pyx_XDECREF(__pyx_t_1);
18175  __Pyx_AddTraceback("View.MemoryView._memoryviewslice.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
18176  __pyx_r = NULL;
18177  __Pyx_XGIVEREF(__pyx_r);
18178  __Pyx_RefNannyFinishContext();
18179  return __pyx_r;
18180 }
18181 
18182 /* "(tree fragment)":3
18183  * def __reduce_cython__(self):
18184  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
18185  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
18186  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
18187  */
18188 
18189 /* Python wrapper */
18190 static PyObject *__pyx_pw___pyx_memoryviewslice_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
18191 static PyObject *__pyx_pw___pyx_memoryviewslice_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
18192  PyObject *__pyx_r = 0;
18193  __Pyx_RefNannyDeclarations
18194  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
18195  __pyx_r = __pyx_pf___pyx_memoryviewslice_2__setstate_cython__(((struct __pyx_memoryviewslice_obj *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
18196 
18197  /* function exit code */
18198  __Pyx_RefNannyFinishContext();
18199  return __pyx_r;
18200 }
18201 
18202 static PyObject *__pyx_pf___pyx_memoryviewslice_2__setstate_cython__(CYTHON_UNUSED struct __pyx_memoryviewslice_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
18203  PyObject *__pyx_r = NULL;
18204  __Pyx_RefNannyDeclarations
18205  PyObject *__pyx_t_1 = NULL;
18206  __Pyx_RefNannySetupContext("__setstate_cython__", 0);
18207 
18208  /* "(tree fragment)":4
18209  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
18210  * def __setstate_cython__(self, __pyx_state):
18211  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
18212  */
18213  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__25, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 4, __pyx_L1_error)
18214  __Pyx_GOTREF(__pyx_t_1);
18215  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
18216  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
18217  __PYX_ERR(2, 4, __pyx_L1_error)
18218 
18219  /* "(tree fragment)":3
18220  * def __reduce_cython__(self):
18221  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
18222  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
18223  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
18224  */
18225 
18226  /* function exit code */
18227  __pyx_L1_error:;
18228  __Pyx_XDECREF(__pyx_t_1);
18229  __Pyx_AddTraceback("View.MemoryView._memoryviewslice.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
18230  __pyx_r = NULL;
18231  __Pyx_XGIVEREF(__pyx_r);
18232  __Pyx_RefNannyFinishContext();
18233  return __pyx_r;
18234 }
18235 
18236 /* "View.MemoryView":995
18237  *
18238  * @cname('__pyx_memoryview_fromslice')
18239  * cdef memoryview_fromslice(__Pyx_memviewslice memviewslice, # <<<<<<<<<<<<<<
18240  * int ndim,
18241  * object (*to_object_func)(char *),
18242  */
18243 
18244 static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewslice, int __pyx_v_ndim, PyObject *(*__pyx_v_to_object_func)(char *), int (*__pyx_v_to_dtype_func)(char *, PyObject *), int __pyx_v_dtype_is_object) {
18245  struct __pyx_memoryviewslice_obj *__pyx_v_result = 0;
18246  Py_ssize_t __pyx_v_suboffset;
18247  PyObject *__pyx_v_length = NULL;
18248  PyObject *__pyx_r = NULL;
18249  __Pyx_RefNannyDeclarations
18250  int __pyx_t_1;
18251  PyObject *__pyx_t_2 = NULL;
18252  PyObject *__pyx_t_3 = NULL;
18253  __Pyx_TypeInfo *__pyx_t_4;
18254  Py_buffer __pyx_t_5;
18255  Py_ssize_t *__pyx_t_6;
18256  Py_ssize_t *__pyx_t_7;
18257  Py_ssize_t *__pyx_t_8;
18258  Py_ssize_t __pyx_t_9;
18259  __Pyx_RefNannySetupContext("memoryview_fromslice", 0);
18260 
18261  /* "View.MemoryView":1003
18262  * cdef _memoryviewslice result
18263  *
18264  * if <PyObject *> memviewslice.memview == Py_None: # <<<<<<<<<<<<<<
18265  * return None
18266  *
18267  */
18268  __pyx_t_1 = ((((PyObject *)__pyx_v_memviewslice.memview) == Py_None) != 0);
18269  if (__pyx_t_1) {
18270 
18271  /* "View.MemoryView":1004
18272  *
18273  * if <PyObject *> memviewslice.memview == Py_None:
18274  * return None # <<<<<<<<<<<<<<
18275  *
18276  *
18277  */
18278  __Pyx_XDECREF(__pyx_r);
18279  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
18280  goto __pyx_L0;
18281 
18282  /* "View.MemoryView":1003
18283  * cdef _memoryviewslice result
18284  *
18285  * if <PyObject *> memviewslice.memview == Py_None: # <<<<<<<<<<<<<<
18286  * return None
18287  *
18288  */
18289  }
18290 
18291  /* "View.MemoryView":1009
18292  *
18293  *
18294  * result = _memoryviewslice(None, 0, dtype_is_object) # <<<<<<<<<<<<<<
18295  *
18296  * result.from_slice = memviewslice
18297  */
18298  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1009, __pyx_L1_error)
18299  __Pyx_GOTREF(__pyx_t_2);
18300  __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 1009, __pyx_L1_error)
18301  __Pyx_GOTREF(__pyx_t_3);
18302  __Pyx_INCREF(Py_None);
18303  __Pyx_GIVEREF(Py_None);
18304  PyTuple_SET_ITEM(__pyx_t_3, 0, Py_None);
18305  __Pyx_INCREF(__pyx_int_0);
18306  __Pyx_GIVEREF(__pyx_int_0);
18307  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_int_0);
18308  __Pyx_GIVEREF(__pyx_t_2);
18309  PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2);
18310  __pyx_t_2 = 0;
18311  __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryviewslice_type), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1009, __pyx_L1_error)
18312  __Pyx_GOTREF(__pyx_t_2);
18313  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
18314  __pyx_v_result = ((struct __pyx_memoryviewslice_obj *)__pyx_t_2);
18315  __pyx_t_2 = 0;
18316 
18317  /* "View.MemoryView":1011
18318  * result = _memoryviewslice(None, 0, dtype_is_object)
18319  *
18320  * result.from_slice = memviewslice # <<<<<<<<<<<<<<
18321  * __PYX_INC_MEMVIEW(&memviewslice, 1)
18322  *
18323  */
18324  __pyx_v_result->from_slice = __pyx_v_memviewslice;
18325 
18326  /* "View.MemoryView":1012
18327  *
18328  * result.from_slice = memviewslice
18329  * __PYX_INC_MEMVIEW(&memviewslice, 1) # <<<<<<<<<<<<<<
18330  *
18331  * result.from_object = (<memoryview> memviewslice.memview).base
18332  */
18333  __PYX_INC_MEMVIEW((&__pyx_v_memviewslice), 1);
18334 
18335  /* "View.MemoryView":1014
18336  * __PYX_INC_MEMVIEW(&memviewslice, 1)
18337  *
18338  * result.from_object = (<memoryview> memviewslice.memview).base # <<<<<<<<<<<<<<
18339  * result.typeinfo = memviewslice.memview.typeinfo
18340  *
18341  */
18342  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_memviewslice.memview), __pyx_n_s_base); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1014, __pyx_L1_error)
18343  __Pyx_GOTREF(__pyx_t_2);
18344  __Pyx_GIVEREF(__pyx_t_2);
18345  __Pyx_GOTREF(__pyx_v_result->from_object);
18346  __Pyx_DECREF(__pyx_v_result->from_object);
18347  __pyx_v_result->from_object = __pyx_t_2;
18348  __pyx_t_2 = 0;
18349 
18350  /* "View.MemoryView":1015
18351  *
18352  * result.from_object = (<memoryview> memviewslice.memview).base
18353  * result.typeinfo = memviewslice.memview.typeinfo # <<<<<<<<<<<<<<
18354  *
18355  * result.view = memviewslice.memview.view
18356  */
18357  __pyx_t_4 = __pyx_v_memviewslice.memview->typeinfo;
18358  __pyx_v_result->__pyx_base.typeinfo = __pyx_t_4;
18359 
18360  /* "View.MemoryView":1017
18361  * result.typeinfo = memviewslice.memview.typeinfo
18362  *
18363  * result.view = memviewslice.memview.view # <<<<<<<<<<<<<<
18364  * result.view.buf = <void *> memviewslice.data
18365  * result.view.ndim = ndim
18366  */
18367  __pyx_t_5 = __pyx_v_memviewslice.memview->view;
18368  __pyx_v_result->__pyx_base.view = __pyx_t_5;
18369 
18370  /* "View.MemoryView":1018
18371  *
18372  * result.view = memviewslice.memview.view
18373  * result.view.buf = <void *> memviewslice.data # <<<<<<<<<<<<<<
18374  * result.view.ndim = ndim
18375  * (<__pyx_buffer *> &result.view).obj = Py_None
18376  */
18377  __pyx_v_result->__pyx_base.view.buf = ((void *)__pyx_v_memviewslice.data);
18378 
18379  /* "View.MemoryView":1019
18380  * result.view = memviewslice.memview.view
18381  * result.view.buf = <void *> memviewslice.data
18382  * result.view.ndim = ndim # <<<<<<<<<<<<<<
18383  * (<__pyx_buffer *> &result.view).obj = Py_None
18384  * Py_INCREF(Py_None)
18385  */
18386  __pyx_v_result->__pyx_base.view.ndim = __pyx_v_ndim;
18387 
18388  /* "View.MemoryView":1020
18389  * result.view.buf = <void *> memviewslice.data
18390  * result.view.ndim = ndim
18391  * (<__pyx_buffer *> &result.view).obj = Py_None # <<<<<<<<<<<<<<
18392  * Py_INCREF(Py_None)
18393  *
18394  */
18395  ((Py_buffer *)(&__pyx_v_result->__pyx_base.view))->obj = Py_None;
18396 
18397  /* "View.MemoryView":1021
18398  * result.view.ndim = ndim
18399  * (<__pyx_buffer *> &result.view).obj = Py_None
18400  * Py_INCREF(Py_None) # <<<<<<<<<<<<<<
18401  *
18402  * if (<memoryview>memviewslice.memview).flags & PyBUF_WRITABLE:
18403  */
18404  Py_INCREF(Py_None);
18405 
18406  /* "View.MemoryView":1023
18407  * Py_INCREF(Py_None)
18408  *
18409  * if (<memoryview>memviewslice.memview).flags & PyBUF_WRITABLE: # <<<<<<<<<<<<<<
18410  * result.flags = PyBUF_RECORDS
18411  * else:
18412  */
18413  __pyx_t_1 = ((((struct __pyx_memoryview_obj *)__pyx_v_memviewslice.memview)->flags & PyBUF_WRITABLE) != 0);
18414  if (__pyx_t_1) {
18415 
18416  /* "View.MemoryView":1024
18417  *
18418  * if (<memoryview>memviewslice.memview).flags & PyBUF_WRITABLE:
18419  * result.flags = PyBUF_RECORDS # <<<<<<<<<<<<<<
18420  * else:
18421  * result.flags = PyBUF_RECORDS_RO
18422  */
18423  __pyx_v_result->__pyx_base.flags = PyBUF_RECORDS;
18424 
18425  /* "View.MemoryView":1023
18426  * Py_INCREF(Py_None)
18427  *
18428  * if (<memoryview>memviewslice.memview).flags & PyBUF_WRITABLE: # <<<<<<<<<<<<<<
18429  * result.flags = PyBUF_RECORDS
18430  * else:
18431  */
18432  goto __pyx_L4;
18433  }
18434 
18435  /* "View.MemoryView":1026
18436  * result.flags = PyBUF_RECORDS
18437  * else:
18438  * result.flags = PyBUF_RECORDS_RO # <<<<<<<<<<<<<<
18439  *
18440  * result.view.shape = <Py_ssize_t *> result.from_slice.shape
18441  */
18442  /*else*/ {
18443  __pyx_v_result->__pyx_base.flags = PyBUF_RECORDS_RO;
18444  }
18445  __pyx_L4:;
18446 
18447  /* "View.MemoryView":1028
18448  * result.flags = PyBUF_RECORDS_RO
18449  *
18450  * result.view.shape = <Py_ssize_t *> result.from_slice.shape # <<<<<<<<<<<<<<
18451  * result.view.strides = <Py_ssize_t *> result.from_slice.strides
18452  *
18453  */
18454  __pyx_v_result->__pyx_base.view.shape = ((Py_ssize_t *)__pyx_v_result->from_slice.shape);
18455 
18456  /* "View.MemoryView":1029
18457  *
18458  * result.view.shape = <Py_ssize_t *> result.from_slice.shape
18459  * result.view.strides = <Py_ssize_t *> result.from_slice.strides # <<<<<<<<<<<<<<
18460  *
18461  *
18462  */
18463  __pyx_v_result->__pyx_base.view.strides = ((Py_ssize_t *)__pyx_v_result->from_slice.strides);
18464 
18465  /* "View.MemoryView":1032
18466  *
18467  *
18468  * result.view.suboffsets = NULL # <<<<<<<<<<<<<<
18469  * for suboffset in result.from_slice.suboffsets[:ndim]:
18470  * if suboffset >= 0:
18471  */
18472  __pyx_v_result->__pyx_base.view.suboffsets = NULL;
18473 
18474  /* "View.MemoryView":1033
18475  *
18476  * result.view.suboffsets = NULL
18477  * for suboffset in result.from_slice.suboffsets[:ndim]: # <<<<<<<<<<<<<<
18478  * if suboffset >= 0:
18479  * result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets
18480  */
18481  __pyx_t_7 = (__pyx_v_result->from_slice.suboffsets + __pyx_v_ndim);
18482  for (__pyx_t_8 = __pyx_v_result->from_slice.suboffsets; __pyx_t_8 < __pyx_t_7; __pyx_t_8++) {
18483  __pyx_t_6 = __pyx_t_8;
18484  __pyx_v_suboffset = (__pyx_t_6[0]);
18485 
18486  /* "View.MemoryView":1034
18487  * result.view.suboffsets = NULL
18488  * for suboffset in result.from_slice.suboffsets[:ndim]:
18489  * if suboffset >= 0: # <<<<<<<<<<<<<<
18490  * result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets
18491  * break
18492  */
18493  __pyx_t_1 = ((__pyx_v_suboffset >= 0) != 0);
18494  if (__pyx_t_1) {
18495 
18496  /* "View.MemoryView":1035
18497  * for suboffset in result.from_slice.suboffsets[:ndim]:
18498  * if suboffset >= 0:
18499  * result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets # <<<<<<<<<<<<<<
18500  * break
18501  *
18502  */
18503  __pyx_v_result->__pyx_base.view.suboffsets = ((Py_ssize_t *)__pyx_v_result->from_slice.suboffsets);
18504 
18505  /* "View.MemoryView":1036
18506  * if suboffset >= 0:
18507  * result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets
18508  * break # <<<<<<<<<<<<<<
18509  *
18510  * result.view.len = result.view.itemsize
18511  */
18512  goto __pyx_L6_break;
18513 
18514  /* "View.MemoryView":1034
18515  * result.view.suboffsets = NULL
18516  * for suboffset in result.from_slice.suboffsets[:ndim]:
18517  * if suboffset >= 0: # <<<<<<<<<<<<<<
18518  * result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets
18519  * break
18520  */
18521  }
18522  }
18523  __pyx_L6_break:;
18524 
18525  /* "View.MemoryView":1038
18526  * break
18527  *
18528  * result.view.len = result.view.itemsize # <<<<<<<<<<<<<<
18529  * for length in result.view.shape[:ndim]:
18530  * result.view.len *= length
18531  */
18532  __pyx_t_9 = __pyx_v_result->__pyx_base.view.itemsize;
18533  __pyx_v_result->__pyx_base.view.len = __pyx_t_9;
18534 
18535  /* "View.MemoryView":1039
18536  *
18537  * result.view.len = result.view.itemsize
18538  * for length in result.view.shape[:ndim]: # <<<<<<<<<<<<<<
18539  * result.view.len *= length
18540  *
18541  */
18542  __pyx_t_7 = (__pyx_v_result->__pyx_base.view.shape + __pyx_v_ndim);
18543  for (__pyx_t_8 = __pyx_v_result->__pyx_base.view.shape; __pyx_t_8 < __pyx_t_7; __pyx_t_8++) {
18544  __pyx_t_6 = __pyx_t_8;
18545  __pyx_t_2 = PyInt_FromSsize_t((__pyx_t_6[0])); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1039, __pyx_L1_error)
18546  __Pyx_GOTREF(__pyx_t_2);
18547  __Pyx_XDECREF_SET(__pyx_v_length, __pyx_t_2);
18548  __pyx_t_2 = 0;
18549 
18550  /* "View.MemoryView":1040
18551  * result.view.len = result.view.itemsize
18552  * for length in result.view.shape[:ndim]:
18553  * result.view.len *= length # <<<<<<<<<<<<<<
18554  *
18555  * result.to_object_func = to_object_func
18556  */
18557  __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_result->__pyx_base.view.len); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1040, __pyx_L1_error)
18558  __Pyx_GOTREF(__pyx_t_2);
18559  __pyx_t_3 = PyNumber_InPlaceMultiply(__pyx_t_2, __pyx_v_length); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 1040, __pyx_L1_error)
18560  __Pyx_GOTREF(__pyx_t_3);
18561  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
18562  __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(2, 1040, __pyx_L1_error)
18563  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
18564  __pyx_v_result->__pyx_base.view.len = __pyx_t_9;
18565  }
18566 
18567  /* "View.MemoryView":1042
18568  * result.view.len *= length
18569  *
18570  * result.to_object_func = to_object_func # <<<<<<<<<<<<<<
18571  * result.to_dtype_func = to_dtype_func
18572  *
18573  */
18574  __pyx_v_result->to_object_func = __pyx_v_to_object_func;
18575 
18576  /* "View.MemoryView":1043
18577  *
18578  * result.to_object_func = to_object_func
18579  * result.to_dtype_func = to_dtype_func # <<<<<<<<<<<<<<
18580  *
18581  * return result
18582  */
18583  __pyx_v_result->to_dtype_func = __pyx_v_to_dtype_func;
18584 
18585  /* "View.MemoryView":1045
18586  * result.to_dtype_func = to_dtype_func
18587  *
18588  * return result # <<<<<<<<<<<<<<
18589  *
18590  * @cname('__pyx_memoryview_get_slice_from_memoryview')
18591  */
18592  __Pyx_XDECREF(__pyx_r);
18593  __Pyx_INCREF(((PyObject *)__pyx_v_result));
18594  __pyx_r = ((PyObject *)__pyx_v_result);
18595  goto __pyx_L0;
18596 
18597  /* "View.MemoryView":995
18598  *
18599  * @cname('__pyx_memoryview_fromslice')
18600  * cdef memoryview_fromslice(__Pyx_memviewslice memviewslice, # <<<<<<<<<<<<<<
18601  * int ndim,
18602  * object (*to_object_func)(char *),
18603  */
18604 
18605  /* function exit code */
18606  __pyx_L1_error:;
18607  __Pyx_XDECREF(__pyx_t_2);
18608  __Pyx_XDECREF(__pyx_t_3);
18609  __Pyx_AddTraceback("View.MemoryView.memoryview_fromslice", __pyx_clineno, __pyx_lineno, __pyx_filename);
18610  __pyx_r = 0;
18611  __pyx_L0:;
18612  __Pyx_XDECREF((PyObject *)__pyx_v_result);
18613  __Pyx_XDECREF(__pyx_v_length);
18614  __Pyx_XGIVEREF(__pyx_r);
18615  __Pyx_RefNannyFinishContext();
18616  return __pyx_r;
18617 }
18618 
18619 /* "View.MemoryView":1048
18620  *
18621  * @cname('__pyx_memoryview_get_slice_from_memoryview')
18622  * cdef __Pyx_memviewslice *get_slice_from_memview(memoryview memview, # <<<<<<<<<<<<<<
18623  * __Pyx_memviewslice *mslice):
18624  * cdef _memoryviewslice obj
18625  */
18626 
18627 static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(struct __pyx_memoryview_obj *__pyx_v_memview, __Pyx_memviewslice *__pyx_v_mslice) {
18628  struct __pyx_memoryviewslice_obj *__pyx_v_obj = 0;
18629  __Pyx_memviewslice *__pyx_r;
18630  __Pyx_RefNannyDeclarations
18631  int __pyx_t_1;
18632  int __pyx_t_2;
18633  PyObject *__pyx_t_3 = NULL;
18634  __Pyx_RefNannySetupContext("get_slice_from_memview", 0);
18635 
18636  /* "View.MemoryView":1051
18637  * __Pyx_memviewslice *mslice):
18638  * cdef _memoryviewslice obj
18639  * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
18640  * obj = memview
18641  * return &obj.from_slice
18642  */
18643  __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
18644  __pyx_t_2 = (__pyx_t_1 != 0);
18645  if (__pyx_t_2) {
18646 
18647  /* "View.MemoryView":1052
18648  * cdef _memoryviewslice obj
18649  * if isinstance(memview, _memoryviewslice):
18650  * obj = memview # <<<<<<<<<<<<<<
18651  * return &obj.from_slice
18652  * else:
18653  */
18654  if (!(likely(((((PyObject *)__pyx_v_memview)) == Py_None) || likely(__Pyx_TypeTest(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type))))) __PYX_ERR(2, 1052, __pyx_L1_error)
18655  __pyx_t_3 = ((PyObject *)__pyx_v_memview);
18656  __Pyx_INCREF(__pyx_t_3);
18657  __pyx_v_obj = ((struct __pyx_memoryviewslice_obj *)__pyx_t_3);
18658  __pyx_t_3 = 0;
18659 
18660  /* "View.MemoryView":1053
18661  * if isinstance(memview, _memoryviewslice):
18662  * obj = memview
18663  * return &obj.from_slice # <<<<<<<<<<<<<<
18664  * else:
18665  * slice_copy(memview, mslice)
18666  */
18667  __pyx_r = (&__pyx_v_obj->from_slice);
18668  goto __pyx_L0;
18669 
18670  /* "View.MemoryView":1051
18671  * __Pyx_memviewslice *mslice):
18672  * cdef _memoryviewslice obj
18673  * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
18674  * obj = memview
18675  * return &obj.from_slice
18676  */
18677  }
18678 
18679  /* "View.MemoryView":1055
18680  * return &obj.from_slice
18681  * else:
18682  * slice_copy(memview, mslice) # <<<<<<<<<<<<<<
18683  * return mslice
18684  *
18685  */
18686  /*else*/ {
18687  __pyx_memoryview_slice_copy(__pyx_v_memview, __pyx_v_mslice);
18688 
18689  /* "View.MemoryView":1056
18690  * else:
18691  * slice_copy(memview, mslice)
18692  * return mslice # <<<<<<<<<<<<<<
18693  *
18694  * @cname('__pyx_memoryview_slice_copy')
18695  */
18696  __pyx_r = __pyx_v_mslice;
18697  goto __pyx_L0;
18698  }
18699 
18700  /* "View.MemoryView":1048
18701  *
18702  * @cname('__pyx_memoryview_get_slice_from_memoryview')
18703  * cdef __Pyx_memviewslice *get_slice_from_memview(memoryview memview, # <<<<<<<<<<<<<<
18704  * __Pyx_memviewslice *mslice):
18705  * cdef _memoryviewslice obj
18706  */
18707 
18708  /* function exit code */
18709  __pyx_L1_error:;
18710  __Pyx_XDECREF(__pyx_t_3);
18711  __Pyx_WriteUnraisable("View.MemoryView.get_slice_from_memview", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
18712  __pyx_r = 0;
18713  __pyx_L0:;
18714  __Pyx_XDECREF((PyObject *)__pyx_v_obj);
18715  __Pyx_RefNannyFinishContext();
18716  return __pyx_r;
18717 }
18718 
18719 /* "View.MemoryView":1059
18720  *
18721  * @cname('__pyx_memoryview_slice_copy')
18722  * cdef void slice_copy(memoryview memview, __Pyx_memviewslice *dst): # <<<<<<<<<<<<<<
18723  * cdef int dim
18724  * cdef (Py_ssize_t*) shape, strides, suboffsets
18725  */
18726 
18727 static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *__pyx_v_memview, __Pyx_memviewslice *__pyx_v_dst) {
18728  int __pyx_v_dim;
18729  Py_ssize_t *__pyx_v_shape;
18730  Py_ssize_t *__pyx_v_strides;
18731  Py_ssize_t *__pyx_v_suboffsets;
18732  __Pyx_RefNannyDeclarations
18733  Py_ssize_t *__pyx_t_1;
18734  int __pyx_t_2;
18735  int __pyx_t_3;
18736  int __pyx_t_4;
18737  Py_ssize_t __pyx_t_5;
18738  __Pyx_RefNannySetupContext("slice_copy", 0);
18739 
18740  /* "View.MemoryView":1063
18741  * cdef (Py_ssize_t*) shape, strides, suboffsets
18742  *
18743  * shape = memview.view.shape # <<<<<<<<<<<<<<
18744  * strides = memview.view.strides
18745  * suboffsets = memview.view.suboffsets
18746  */
18747  __pyx_t_1 = __pyx_v_memview->view.shape;
18748  __pyx_v_shape = __pyx_t_1;
18749 
18750  /* "View.MemoryView":1064
18751  *
18752  * shape = memview.view.shape
18753  * strides = memview.view.strides # <<<<<<<<<<<<<<
18754  * suboffsets = memview.view.suboffsets
18755  *
18756  */
18757  __pyx_t_1 = __pyx_v_memview->view.strides;
18758  __pyx_v_strides = __pyx_t_1;
18759 
18760  /* "View.MemoryView":1065
18761  * shape = memview.view.shape
18762  * strides = memview.view.strides
18763  * suboffsets = memview.view.suboffsets # <<<<<<<<<<<<<<
18764  *
18765  * dst.memview = <__pyx_memoryview *> memview
18766  */
18767  __pyx_t_1 = __pyx_v_memview->view.suboffsets;
18768  __pyx_v_suboffsets = __pyx_t_1;
18769 
18770  /* "View.MemoryView":1067
18771  * suboffsets = memview.view.suboffsets
18772  *
18773  * dst.memview = <__pyx_memoryview *> memview # <<<<<<<<<<<<<<
18774  * dst.data = <char *> memview.view.buf
18775  *
18776  */
18777  __pyx_v_dst->memview = ((struct __pyx_memoryview_obj *)__pyx_v_memview);
18778 
18779  /* "View.MemoryView":1068
18780  *
18781  * dst.memview = <__pyx_memoryview *> memview
18782  * dst.data = <char *> memview.view.buf # <<<<<<<<<<<<<<
18783  *
18784  * for dim in range(memview.view.ndim):
18785  */
18786  __pyx_v_dst->data = ((char *)__pyx_v_memview->view.buf);
18787 
18788  /* "View.MemoryView":1070
18789  * dst.data = <char *> memview.view.buf
18790  *
18791  * for dim in range(memview.view.ndim): # <<<<<<<<<<<<<<
18792  * dst.shape[dim] = shape[dim]
18793  * dst.strides[dim] = strides[dim]
18794  */
18795  __pyx_t_2 = __pyx_v_memview->view.ndim;
18796  __pyx_t_3 = __pyx_t_2;
18797  for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
18798  __pyx_v_dim = __pyx_t_4;
18799 
18800  /* "View.MemoryView":1071
18801  *
18802  * for dim in range(memview.view.ndim):
18803  * dst.shape[dim] = shape[dim] # <<<<<<<<<<<<<<
18804  * dst.strides[dim] = strides[dim]
18805  * dst.suboffsets[dim] = suboffsets[dim] if suboffsets else -1
18806  */
18807  (__pyx_v_dst->shape[__pyx_v_dim]) = (__pyx_v_shape[__pyx_v_dim]);
18808 
18809  /* "View.MemoryView":1072
18810  * for dim in range(memview.view.ndim):
18811  * dst.shape[dim] = shape[dim]
18812  * dst.strides[dim] = strides[dim] # <<<<<<<<<<<<<<
18813  * dst.suboffsets[dim] = suboffsets[dim] if suboffsets else -1
18814  *
18815  */
18816  (__pyx_v_dst->strides[__pyx_v_dim]) = (__pyx_v_strides[__pyx_v_dim]);
18817 
18818  /* "View.MemoryView":1073
18819  * dst.shape[dim] = shape[dim]
18820  * dst.strides[dim] = strides[dim]
18821  * dst.suboffsets[dim] = suboffsets[dim] if suboffsets else -1 # <<<<<<<<<<<<<<
18822  *
18823  * @cname('__pyx_memoryview_copy_object')
18824  */
18825  if ((__pyx_v_suboffsets != 0)) {
18826  __pyx_t_5 = (__pyx_v_suboffsets[__pyx_v_dim]);
18827  } else {
18828  __pyx_t_5 = -1L;
18829  }
18830  (__pyx_v_dst->suboffsets[__pyx_v_dim]) = __pyx_t_5;
18831  }
18832 
18833  /* "View.MemoryView":1059
18834  *
18835  * @cname('__pyx_memoryview_slice_copy')
18836  * cdef void slice_copy(memoryview memview, __Pyx_memviewslice *dst): # <<<<<<<<<<<<<<
18837  * cdef int dim
18838  * cdef (Py_ssize_t*) shape, strides, suboffsets
18839  */
18840 
18841  /* function exit code */
18842  __Pyx_RefNannyFinishContext();
18843 }
18844 
18845 /* "View.MemoryView":1076
18846  *
18847  * @cname('__pyx_memoryview_copy_object')
18848  * cdef memoryview_copy(memoryview memview): # <<<<<<<<<<<<<<
18849  * "Create a new memoryview object"
18850  * cdef __Pyx_memviewslice memviewslice
18851  */
18852 
18853 static PyObject *__pyx_memoryview_copy_object(struct __pyx_memoryview_obj *__pyx_v_memview) {
18854  __Pyx_memviewslice __pyx_v_memviewslice;
18855  PyObject *__pyx_r = NULL;
18856  __Pyx_RefNannyDeclarations
18857  PyObject *__pyx_t_1 = NULL;
18858  __Pyx_RefNannySetupContext("memoryview_copy", 0);
18859 
18860  /* "View.MemoryView":1079
18861  * "Create a new memoryview object"
18862  * cdef __Pyx_memviewslice memviewslice
18863  * slice_copy(memview, &memviewslice) # <<<<<<<<<<<<<<
18864  * return memoryview_copy_from_slice(memview, &memviewslice)
18865  *
18866  */
18867  __pyx_memoryview_slice_copy(__pyx_v_memview, (&__pyx_v_memviewslice));
18868 
18869  /* "View.MemoryView":1080
18870  * cdef __Pyx_memviewslice memviewslice
18871  * slice_copy(memview, &memviewslice)
18872  * return memoryview_copy_from_slice(memview, &memviewslice) # <<<<<<<<<<<<<<
18873  *
18874  * @cname('__pyx_memoryview_copy_object_from_slice')
18875  */
18876  __Pyx_XDECREF(__pyx_r);
18877  __pyx_t_1 = __pyx_memoryview_copy_object_from_slice(__pyx_v_memview, (&__pyx_v_memviewslice)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 1080, __pyx_L1_error)
18878  __Pyx_GOTREF(__pyx_t_1);
18879  __pyx_r = __pyx_t_1;
18880  __pyx_t_1 = 0;
18881  goto __pyx_L0;
18882 
18883  /* "View.MemoryView":1076
18884  *
18885  * @cname('__pyx_memoryview_copy_object')
18886  * cdef memoryview_copy(memoryview memview): # <<<<<<<<<<<<<<
18887  * "Create a new memoryview object"
18888  * cdef __Pyx_memviewslice memviewslice
18889  */
18890 
18891  /* function exit code */
18892  __pyx_L1_error:;
18893  __Pyx_XDECREF(__pyx_t_1);
18894  __Pyx_AddTraceback("View.MemoryView.memoryview_copy", __pyx_clineno, __pyx_lineno, __pyx_filename);
18895  __pyx_r = 0;
18896  __pyx_L0:;
18897  __Pyx_XGIVEREF(__pyx_r);
18898  __Pyx_RefNannyFinishContext();
18899  return __pyx_r;
18900 }
18901 
18902 /* "View.MemoryView":1083
18903  *
18904  * @cname('__pyx_memoryview_copy_object_from_slice')
18905  * cdef memoryview_copy_from_slice(memoryview memview, __Pyx_memviewslice *memviewslice): # <<<<<<<<<<<<<<
18906  * """
18907  * Create a new memoryview object from a given memoryview object and slice.
18908  */
18909 
18910 static PyObject *__pyx_memoryview_copy_object_from_slice(struct __pyx_memoryview_obj *__pyx_v_memview, __Pyx_memviewslice *__pyx_v_memviewslice) {
18911  PyObject *(*__pyx_v_to_object_func)(char *);
18912  int (*__pyx_v_to_dtype_func)(char *, PyObject *);
18913  PyObject *__pyx_r = NULL;
18914  __Pyx_RefNannyDeclarations
18915  int __pyx_t_1;
18916  int __pyx_t_2;
18917  PyObject *(*__pyx_t_3)(char *);
18918  int (*__pyx_t_4)(char *, PyObject *);
18919  PyObject *__pyx_t_5 = NULL;
18920  __Pyx_RefNannySetupContext("memoryview_copy_from_slice", 0);
18921 
18922  /* "View.MemoryView":1090
18923  * cdef int (*to_dtype_func)(char *, object) except 0
18924  *
18925  * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
18926  * to_object_func = (<_memoryviewslice> memview).to_object_func
18927  * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func
18928  */
18929  __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
18930  __pyx_t_2 = (__pyx_t_1 != 0);
18931  if (__pyx_t_2) {
18932 
18933  /* "View.MemoryView":1091
18934  *
18935  * if isinstance(memview, _memoryviewslice):
18936  * to_object_func = (<_memoryviewslice> memview).to_object_func # <<<<<<<<<<<<<<
18937  * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func
18938  * else:
18939  */
18940  __pyx_t_3 = ((struct __pyx_memoryviewslice_obj *)__pyx_v_memview)->to_object_func;
18941  __pyx_v_to_object_func = __pyx_t_3;
18942 
18943  /* "View.MemoryView":1092
18944  * if isinstance(memview, _memoryviewslice):
18945  * to_object_func = (<_memoryviewslice> memview).to_object_func
18946  * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func # <<<<<<<<<<<<<<
18947  * else:
18948  * to_object_func = NULL
18949  */
18950  __pyx_t_4 = ((struct __pyx_memoryviewslice_obj *)__pyx_v_memview)->to_dtype_func;
18951  __pyx_v_to_dtype_func = __pyx_t_4;
18952 
18953  /* "View.MemoryView":1090
18954  * cdef int (*to_dtype_func)(char *, object) except 0
18955  *
18956  * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
18957  * to_object_func = (<_memoryviewslice> memview).to_object_func
18958  * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func
18959  */
18960  goto __pyx_L3;
18961  }
18962 
18963  /* "View.MemoryView":1094
18964  * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func
18965  * else:
18966  * to_object_func = NULL # <<<<<<<<<<<<<<
18967  * to_dtype_func = NULL
18968  *
18969  */
18970  /*else*/ {
18971  __pyx_v_to_object_func = NULL;
18972 
18973  /* "View.MemoryView":1095
18974  * else:
18975  * to_object_func = NULL
18976  * to_dtype_func = NULL # <<<<<<<<<<<<<<
18977  *
18978  * return memoryview_fromslice(memviewslice[0], memview.view.ndim,
18979  */
18980  __pyx_v_to_dtype_func = NULL;
18981  }
18982  __pyx_L3:;
18983 
18984  /* "View.MemoryView":1097
18985  * to_dtype_func = NULL
18986  *
18987  * return memoryview_fromslice(memviewslice[0], memview.view.ndim, # <<<<<<<<<<<<<<
18988  * to_object_func, to_dtype_func,
18989  * memview.dtype_is_object)
18990  */
18991  __Pyx_XDECREF(__pyx_r);
18992 
18993  /* "View.MemoryView":1099
18994  * return memoryview_fromslice(memviewslice[0], memview.view.ndim,
18995  * to_object_func, to_dtype_func,
18996  * memview.dtype_is_object) # <<<<<<<<<<<<<<
18997  *
18998  *
18999  */
19000  __pyx_t_5 = __pyx_memoryview_fromslice((__pyx_v_memviewslice[0]), __pyx_v_memview->view.ndim, __pyx_v_to_object_func, __pyx_v_to_dtype_func, __pyx_v_memview->dtype_is_object); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 1097, __pyx_L1_error)
19001  __Pyx_GOTREF(__pyx_t_5);
19002  __pyx_r = __pyx_t_5;
19003  __pyx_t_5 = 0;
19004  goto __pyx_L0;
19005 
19006  /* "View.MemoryView":1083
19007  *
19008  * @cname('__pyx_memoryview_copy_object_from_slice')
19009  * cdef memoryview_copy_from_slice(memoryview memview, __Pyx_memviewslice *memviewslice): # <<<<<<<<<<<<<<
19010  * """
19011  * Create a new memoryview object from a given memoryview object and slice.
19012  */
19013 
19014  /* function exit code */
19015  __pyx_L1_error:;
19016  __Pyx_XDECREF(__pyx_t_5);
19017  __Pyx_AddTraceback("View.MemoryView.memoryview_copy_from_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
19018  __pyx_r = 0;
19019  __pyx_L0:;
19020  __Pyx_XGIVEREF(__pyx_r);
19021  __Pyx_RefNannyFinishContext();
19022  return __pyx_r;
19023 }
19024 
19025 /* "View.MemoryView":1105
19026  *
19027  *
19028  * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil: # <<<<<<<<<<<<<<
19029  * if arg < 0:
19030  * return -arg
19031  */
19032 
19033 static Py_ssize_t abs_py_ssize_t(Py_ssize_t __pyx_v_arg) {
19034  Py_ssize_t __pyx_r;
19035  int __pyx_t_1;
19036 
19037  /* "View.MemoryView":1106
19038  *
19039  * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil:
19040  * if arg < 0: # <<<<<<<<<<<<<<
19041  * return -arg
19042  * else:
19043  */
19044  __pyx_t_1 = ((__pyx_v_arg < 0) != 0);
19045  if (__pyx_t_1) {
19046 
19047  /* "View.MemoryView":1107
19048  * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil:
19049  * if arg < 0:
19050  * return -arg # <<<<<<<<<<<<<<
19051  * else:
19052  * return arg
19053  */
19054  __pyx_r = (-__pyx_v_arg);
19055  goto __pyx_L0;
19056 
19057  /* "View.MemoryView":1106
19058  *
19059  * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil:
19060  * if arg < 0: # <<<<<<<<<<<<<<
19061  * return -arg
19062  * else:
19063  */
19064  }
19065 
19066  /* "View.MemoryView":1109
19067  * return -arg
19068  * else:
19069  * return arg # <<<<<<<<<<<<<<
19070  *
19071  * @cname('__pyx_get_best_slice_order')
19072  */
19073  /*else*/ {
19074  __pyx_r = __pyx_v_arg;
19075  goto __pyx_L0;
19076  }
19077 
19078  /* "View.MemoryView":1105
19079  *
19080  *
19081  * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil: # <<<<<<<<<<<<<<
19082  * if arg < 0:
19083  * return -arg
19084  */
19085 
19086  /* function exit code */
19087  __pyx_L0:;
19088  return __pyx_r;
19089 }
19090 
19091 /* "View.MemoryView":1112
19092  *
19093  * @cname('__pyx_get_best_slice_order')
19094  * cdef char get_best_order(__Pyx_memviewslice *mslice, int ndim) nogil: # <<<<<<<<<<<<<<
19095  * """
19096  * Figure out the best memory access order for a given slice.
19097  */
19098 
19099 static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int __pyx_v_ndim) {
19100  int __pyx_v_i;
19101  Py_ssize_t __pyx_v_c_stride;
19102  Py_ssize_t __pyx_v_f_stride;
19103  char __pyx_r;
19104  int __pyx_t_1;
19105  int __pyx_t_2;
19106  int __pyx_t_3;
19107  int __pyx_t_4;
19108 
19109  /* "View.MemoryView":1117
19110  * """
19111  * cdef int i
19112  * cdef Py_ssize_t c_stride = 0 # <<<<<<<<<<<<<<
19113  * cdef Py_ssize_t f_stride = 0
19114  *
19115  */
19116  __pyx_v_c_stride = 0;
19117 
19118  /* "View.MemoryView":1118
19119  * cdef int i
19120  * cdef Py_ssize_t c_stride = 0
19121  * cdef Py_ssize_t f_stride = 0 # <<<<<<<<<<<<<<
19122  *
19123  * for i in range(ndim - 1, -1, -1):
19124  */
19125  __pyx_v_f_stride = 0;
19126 
19127  /* "View.MemoryView":1120
19128  * cdef Py_ssize_t f_stride = 0
19129  *
19130  * for i in range(ndim - 1, -1, -1): # <<<<<<<<<<<<<<
19131  * if mslice.shape[i] > 1:
19132  * c_stride = mslice.strides[i]
19133  */
19134  for (__pyx_t_1 = (__pyx_v_ndim - 1); __pyx_t_1 > -1; __pyx_t_1-=1) {
19135  __pyx_v_i = __pyx_t_1;
19136 
19137  /* "View.MemoryView":1121
19138  *
19139  * for i in range(ndim - 1, -1, -1):
19140  * if mslice.shape[i] > 1: # <<<<<<<<<<<<<<
19141  * c_stride = mslice.strides[i]
19142  * break
19143  */
19144  __pyx_t_2 = (((__pyx_v_mslice->shape[__pyx_v_i]) > 1) != 0);
19145  if (__pyx_t_2) {
19146 
19147  /* "View.MemoryView":1122
19148  * for i in range(ndim - 1, -1, -1):
19149  * if mslice.shape[i] > 1:
19150  * c_stride = mslice.strides[i] # <<<<<<<<<<<<<<
19151  * break
19152  *
19153  */
19154  __pyx_v_c_stride = (__pyx_v_mslice->strides[__pyx_v_i]);
19155 
19156  /* "View.MemoryView":1123
19157  * if mslice.shape[i] > 1:
19158  * c_stride = mslice.strides[i]
19159  * break # <<<<<<<<<<<<<<
19160  *
19161  * for i in range(ndim):
19162  */
19163  goto __pyx_L4_break;
19164 
19165  /* "View.MemoryView":1121
19166  *
19167  * for i in range(ndim - 1, -1, -1):
19168  * if mslice.shape[i] > 1: # <<<<<<<<<<<<<<
19169  * c_stride = mslice.strides[i]
19170  * break
19171  */
19172  }
19173  }
19174  __pyx_L4_break:;
19175 
19176  /* "View.MemoryView":1125
19177  * break
19178  *
19179  * for i in range(ndim): # <<<<<<<<<<<<<<
19180  * if mslice.shape[i] > 1:
19181  * f_stride = mslice.strides[i]
19182  */
19183  __pyx_t_1 = __pyx_v_ndim;
19184  __pyx_t_3 = __pyx_t_1;
19185  for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
19186  __pyx_v_i = __pyx_t_4;
19187 
19188  /* "View.MemoryView":1126
19189  *
19190  * for i in range(ndim):
19191  * if mslice.shape[i] > 1: # <<<<<<<<<<<<<<
19192  * f_stride = mslice.strides[i]
19193  * break
19194  */
19195  __pyx_t_2 = (((__pyx_v_mslice->shape[__pyx_v_i]) > 1) != 0);
19196  if (__pyx_t_2) {
19197 
19198  /* "View.MemoryView":1127
19199  * for i in range(ndim):
19200  * if mslice.shape[i] > 1:
19201  * f_stride = mslice.strides[i] # <<<<<<<<<<<<<<
19202  * break
19203  *
19204  */
19205  __pyx_v_f_stride = (__pyx_v_mslice->strides[__pyx_v_i]);
19206 
19207  /* "View.MemoryView":1128
19208  * if mslice.shape[i] > 1:
19209  * f_stride = mslice.strides[i]
19210  * break # <<<<<<<<<<<<<<
19211  *
19212  * if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride):
19213  */
19214  goto __pyx_L7_break;
19215 
19216  /* "View.MemoryView":1126
19217  *
19218  * for i in range(ndim):
19219  * if mslice.shape[i] > 1: # <<<<<<<<<<<<<<
19220  * f_stride = mslice.strides[i]
19221  * break
19222  */
19223  }
19224  }
19225  __pyx_L7_break:;
19226 
19227  /* "View.MemoryView":1130
19228  * break
19229  *
19230  * if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride): # <<<<<<<<<<<<<<
19231  * return 'C'
19232  * else:
19233  */
19234  __pyx_t_2 = ((abs_py_ssize_t(__pyx_v_c_stride) <= abs_py_ssize_t(__pyx_v_f_stride)) != 0);
19235  if (__pyx_t_2) {
19236 
19237  /* "View.MemoryView":1131
19238  *
19239  * if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride):
19240  * return 'C' # <<<<<<<<<<<<<<
19241  * else:
19242  * return 'F'
19243  */
19244  __pyx_r = 'C';
19245  goto __pyx_L0;
19246 
19247  /* "View.MemoryView":1130
19248  * break
19249  *
19250  * if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride): # <<<<<<<<<<<<<<
19251  * return 'C'
19252  * else:
19253  */
19254  }
19255 
19256  /* "View.MemoryView":1133
19257  * return 'C'
19258  * else:
19259  * return 'F' # <<<<<<<<<<<<<<
19260  *
19261  * @cython.cdivision(True)
19262  */
19263  /*else*/ {
19264  __pyx_r = 'F';
19265  goto __pyx_L0;
19266  }
19267 
19268  /* "View.MemoryView":1112
19269  *
19270  * @cname('__pyx_get_best_slice_order')
19271  * cdef char get_best_order(__Pyx_memviewslice *mslice, int ndim) nogil: # <<<<<<<<<<<<<<
19272  * """
19273  * Figure out the best memory access order for a given slice.
19274  */
19275 
19276  /* function exit code */
19277  __pyx_L0:;
19278  return __pyx_r;
19279 }
19280 
19281 /* "View.MemoryView":1136
19282  *
19283  * @cython.cdivision(True)
19284  * cdef void _copy_strided_to_strided(char *src_data, Py_ssize_t *src_strides, # <<<<<<<<<<<<<<
19285  * char *dst_data, Py_ssize_t *dst_strides,
19286  * Py_ssize_t *src_shape, Py_ssize_t *dst_shape,
19287  */
19288 
19289 static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v_src_strides, char *__pyx_v_dst_data, Py_ssize_t *__pyx_v_dst_strides, Py_ssize_t *__pyx_v_src_shape, Py_ssize_t *__pyx_v_dst_shape, int __pyx_v_ndim, size_t __pyx_v_itemsize) {
19290  CYTHON_UNUSED Py_ssize_t __pyx_v_i;
19291  CYTHON_UNUSED Py_ssize_t __pyx_v_src_extent;
19292  Py_ssize_t __pyx_v_dst_extent;
19293  Py_ssize_t __pyx_v_src_stride;
19294  Py_ssize_t __pyx_v_dst_stride;
19295  int __pyx_t_1;
19296  int __pyx_t_2;
19297  int __pyx_t_3;
19298  Py_ssize_t __pyx_t_4;
19299  Py_ssize_t __pyx_t_5;
19300  Py_ssize_t __pyx_t_6;
19301 
19302  /* "View.MemoryView":1143
19303  *
19304  * cdef Py_ssize_t i
19305  * cdef Py_ssize_t src_extent = src_shape[0] # <<<<<<<<<<<<<<
19306  * cdef Py_ssize_t dst_extent = dst_shape[0]
19307  * cdef Py_ssize_t src_stride = src_strides[0]
19308  */
19309  __pyx_v_src_extent = (__pyx_v_src_shape[0]);
19310 
19311  /* "View.MemoryView":1144
19312  * cdef Py_ssize_t i
19313  * cdef Py_ssize_t src_extent = src_shape[0]
19314  * cdef Py_ssize_t dst_extent = dst_shape[0] # <<<<<<<<<<<<<<
19315  * cdef Py_ssize_t src_stride = src_strides[0]
19316  * cdef Py_ssize_t dst_stride = dst_strides[0]
19317  */
19318  __pyx_v_dst_extent = (__pyx_v_dst_shape[0]);
19319 
19320  /* "View.MemoryView":1145
19321  * cdef Py_ssize_t src_extent = src_shape[0]
19322  * cdef Py_ssize_t dst_extent = dst_shape[0]
19323  * cdef Py_ssize_t src_stride = src_strides[0] # <<<<<<<<<<<<<<
19324  * cdef Py_ssize_t dst_stride = dst_strides[0]
19325  *
19326  */
19327  __pyx_v_src_stride = (__pyx_v_src_strides[0]);
19328 
19329  /* "View.MemoryView":1146
19330  * cdef Py_ssize_t dst_extent = dst_shape[0]
19331  * cdef Py_ssize_t src_stride = src_strides[0]
19332  * cdef Py_ssize_t dst_stride = dst_strides[0] # <<<<<<<<<<<<<<
19333  *
19334  * if ndim == 1:
19335  */
19336  __pyx_v_dst_stride = (__pyx_v_dst_strides[0]);
19337 
19338  /* "View.MemoryView":1148
19339  * cdef Py_ssize_t dst_stride = dst_strides[0]
19340  *
19341  * if ndim == 1: # <<<<<<<<<<<<<<
19342  * if (src_stride > 0 and dst_stride > 0 and
19343  * <size_t> src_stride == itemsize == <size_t> dst_stride):
19344  */
19345  __pyx_t_1 = ((__pyx_v_ndim == 1) != 0);
19346  if (__pyx_t_1) {
19347 
19348  /* "View.MemoryView":1149
19349  *
19350  * if ndim == 1:
19351  * if (src_stride > 0 and dst_stride > 0 and # <<<<<<<<<<<<<<
19352  * <size_t> src_stride == itemsize == <size_t> dst_stride):
19353  * memcpy(dst_data, src_data, itemsize * dst_extent)
19354  */
19355  __pyx_t_2 = ((__pyx_v_src_stride > 0) != 0);
19356  if (__pyx_t_2) {
19357  } else {
19358  __pyx_t_1 = __pyx_t_2;
19359  goto __pyx_L5_bool_binop_done;
19360  }
19361  __pyx_t_2 = ((__pyx_v_dst_stride > 0) != 0);
19362  if (__pyx_t_2) {
19363  } else {
19364  __pyx_t_1 = __pyx_t_2;
19365  goto __pyx_L5_bool_binop_done;
19366  }
19367 
19368  /* "View.MemoryView":1150
19369  * if ndim == 1:
19370  * if (src_stride > 0 and dst_stride > 0 and
19371  * <size_t> src_stride == itemsize == <size_t> dst_stride): # <<<<<<<<<<<<<<
19372  * memcpy(dst_data, src_data, itemsize * dst_extent)
19373  * else:
19374  */
19375  __pyx_t_2 = (((size_t)__pyx_v_src_stride) == __pyx_v_itemsize);
19376  if (__pyx_t_2) {
19377  __pyx_t_2 = (__pyx_v_itemsize == ((size_t)__pyx_v_dst_stride));
19378  }
19379  __pyx_t_3 = (__pyx_t_2 != 0);
19380  __pyx_t_1 = __pyx_t_3;
19381  __pyx_L5_bool_binop_done:;
19382 
19383  /* "View.MemoryView":1149
19384  *
19385  * if ndim == 1:
19386  * if (src_stride > 0 and dst_stride > 0 and # <<<<<<<<<<<<<<
19387  * <size_t> src_stride == itemsize == <size_t> dst_stride):
19388  * memcpy(dst_data, src_data, itemsize * dst_extent)
19389  */
19390  if (__pyx_t_1) {
19391 
19392  /* "View.MemoryView":1151
19393  * if (src_stride > 0 and dst_stride > 0 and
19394  * <size_t> src_stride == itemsize == <size_t> dst_stride):
19395  * memcpy(dst_data, src_data, itemsize * dst_extent) # <<<<<<<<<<<<<<
19396  * else:
19397  * for i in range(dst_extent):
19398  */
19399  (void)(memcpy(__pyx_v_dst_data, __pyx_v_src_data, (__pyx_v_itemsize * __pyx_v_dst_extent)));
19400 
19401  /* "View.MemoryView":1149
19402  *
19403  * if ndim == 1:
19404  * if (src_stride > 0 and dst_stride > 0 and # <<<<<<<<<<<<<<
19405  * <size_t> src_stride == itemsize == <size_t> dst_stride):
19406  * memcpy(dst_data, src_data, itemsize * dst_extent)
19407  */
19408  goto __pyx_L4;
19409  }
19410 
19411  /* "View.MemoryView":1153
19412  * memcpy(dst_data, src_data, itemsize * dst_extent)
19413  * else:
19414  * for i in range(dst_extent): # <<<<<<<<<<<<<<
19415  * memcpy(dst_data, src_data, itemsize)
19416  * src_data += src_stride
19417  */
19418  /*else*/ {
19419  __pyx_t_4 = __pyx_v_dst_extent;
19420  __pyx_t_5 = __pyx_t_4;
19421  for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
19422  __pyx_v_i = __pyx_t_6;
19423 
19424  /* "View.MemoryView":1154
19425  * else:
19426  * for i in range(dst_extent):
19427  * memcpy(dst_data, src_data, itemsize) # <<<<<<<<<<<<<<
19428  * src_data += src_stride
19429  * dst_data += dst_stride
19430  */
19431  (void)(memcpy(__pyx_v_dst_data, __pyx_v_src_data, __pyx_v_itemsize));
19432 
19433  /* "View.MemoryView":1155
19434  * for i in range(dst_extent):
19435  * memcpy(dst_data, src_data, itemsize)
19436  * src_data += src_stride # <<<<<<<<<<<<<<
19437  * dst_data += dst_stride
19438  * else:
19439  */
19440  __pyx_v_src_data = (__pyx_v_src_data + __pyx_v_src_stride);
19441 
19442  /* "View.MemoryView":1156
19443  * memcpy(dst_data, src_data, itemsize)
19444  * src_data += src_stride
19445  * dst_data += dst_stride # <<<<<<<<<<<<<<
19446  * else:
19447  * for i in range(dst_extent):
19448  */
19449  __pyx_v_dst_data = (__pyx_v_dst_data + __pyx_v_dst_stride);
19450  }
19451  }
19452  __pyx_L4:;
19453 
19454  /* "View.MemoryView":1148
19455  * cdef Py_ssize_t dst_stride = dst_strides[0]
19456  *
19457  * if ndim == 1: # <<<<<<<<<<<<<<
19458  * if (src_stride > 0 and dst_stride > 0 and
19459  * <size_t> src_stride == itemsize == <size_t> dst_stride):
19460  */
19461  goto __pyx_L3;
19462  }
19463 
19464  /* "View.MemoryView":1158
19465  * dst_data += dst_stride
19466  * else:
19467  * for i in range(dst_extent): # <<<<<<<<<<<<<<
19468  * _copy_strided_to_strided(src_data, src_strides + 1,
19469  * dst_data, dst_strides + 1,
19470  */
19471  /*else*/ {
19472  __pyx_t_4 = __pyx_v_dst_extent;
19473  __pyx_t_5 = __pyx_t_4;
19474  for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
19475  __pyx_v_i = __pyx_t_6;
19476 
19477  /* "View.MemoryView":1159
19478  * else:
19479  * for i in range(dst_extent):
19480  * _copy_strided_to_strided(src_data, src_strides + 1, # <<<<<<<<<<<<<<
19481  * dst_data, dst_strides + 1,
19482  * src_shape + 1, dst_shape + 1,
19483  */
19484  _copy_strided_to_strided(__pyx_v_src_data, (__pyx_v_src_strides + 1), __pyx_v_dst_data, (__pyx_v_dst_strides + 1), (__pyx_v_src_shape + 1), (__pyx_v_dst_shape + 1), (__pyx_v_ndim - 1), __pyx_v_itemsize);
19485 
19486  /* "View.MemoryView":1163
19487  * src_shape + 1, dst_shape + 1,
19488  * ndim - 1, itemsize)
19489  * src_data += src_stride # <<<<<<<<<<<<<<
19490  * dst_data += dst_stride
19491  *
19492  */
19493  __pyx_v_src_data = (__pyx_v_src_data + __pyx_v_src_stride);
19494 
19495  /* "View.MemoryView":1164
19496  * ndim - 1, itemsize)
19497  * src_data += src_stride
19498  * dst_data += dst_stride # <<<<<<<<<<<<<<
19499  *
19500  * cdef void copy_strided_to_strided(__Pyx_memviewslice *src,
19501  */
19502  __pyx_v_dst_data = (__pyx_v_dst_data + __pyx_v_dst_stride);
19503  }
19504  }
19505  __pyx_L3:;
19506 
19507  /* "View.MemoryView":1136
19508  *
19509  * @cython.cdivision(True)
19510  * cdef void _copy_strided_to_strided(char *src_data, Py_ssize_t *src_strides, # <<<<<<<<<<<<<<
19511  * char *dst_data, Py_ssize_t *dst_strides,
19512  * Py_ssize_t *src_shape, Py_ssize_t *dst_shape,
19513  */
19514 
19515  /* function exit code */
19516 }
19517 
19518 /* "View.MemoryView":1166
19519  * dst_data += dst_stride
19520  *
19521  * cdef void copy_strided_to_strided(__Pyx_memviewslice *src, # <<<<<<<<<<<<<<
19522  * __Pyx_memviewslice *dst,
19523  * int ndim, size_t itemsize) nogil:
19524  */
19525 
19526 static void copy_strided_to_strided(__Pyx_memviewslice *__pyx_v_src, __Pyx_memviewslice *__pyx_v_dst, int __pyx_v_ndim, size_t __pyx_v_itemsize) {
19527 
19528  /* "View.MemoryView":1169
19529  * __Pyx_memviewslice *dst,
19530  * int ndim, size_t itemsize) nogil:
19531  * _copy_strided_to_strided(src.data, src.strides, dst.data, dst.strides, # <<<<<<<<<<<<<<
19532  * src.shape, dst.shape, ndim, itemsize)
19533  *
19534  */
19535  _copy_strided_to_strided(__pyx_v_src->data, __pyx_v_src->strides, __pyx_v_dst->data, __pyx_v_dst->strides, __pyx_v_src->shape, __pyx_v_dst->shape, __pyx_v_ndim, __pyx_v_itemsize);
19536 
19537  /* "View.MemoryView":1166
19538  * dst_data += dst_stride
19539  *
19540  * cdef void copy_strided_to_strided(__Pyx_memviewslice *src, # <<<<<<<<<<<<<<
19541  * __Pyx_memviewslice *dst,
19542  * int ndim, size_t itemsize) nogil:
19543  */
19544 
19545  /* function exit code */
19546 }
19547 
19548 /* "View.MemoryView":1173
19549  *
19550  * @cname('__pyx_memoryview_slice_get_size')
19551  * cdef Py_ssize_t slice_get_size(__Pyx_memviewslice *src, int ndim) nogil: # <<<<<<<<<<<<<<
19552  * "Return the size of the memory occupied by the slice in number of bytes"
19553  * cdef int i
19554  */
19555 
19556 static Py_ssize_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *__pyx_v_src, int __pyx_v_ndim) {
19557  int __pyx_v_i;
19558  Py_ssize_t __pyx_v_size;
19559  Py_ssize_t __pyx_r;
19560  Py_ssize_t __pyx_t_1;
19561  int __pyx_t_2;
19562  int __pyx_t_3;
19563  int __pyx_t_4;
19564 
19565  /* "View.MemoryView":1176
19566  * "Return the size of the memory occupied by the slice in number of bytes"
19567  * cdef int i
19568  * cdef Py_ssize_t size = src.memview.view.itemsize # <<<<<<<<<<<<<<
19569  *
19570  * for i in range(ndim):
19571  */
19572  __pyx_t_1 = __pyx_v_src->memview->view.itemsize;
19573  __pyx_v_size = __pyx_t_1;
19574 
19575  /* "View.MemoryView":1178
19576  * cdef Py_ssize_t size = src.memview.view.itemsize
19577  *
19578  * for i in range(ndim): # <<<<<<<<<<<<<<
19579  * size *= src.shape[i]
19580  *
19581  */
19582  __pyx_t_2 = __pyx_v_ndim;
19583  __pyx_t_3 = __pyx_t_2;
19584  for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
19585  __pyx_v_i = __pyx_t_4;
19586 
19587  /* "View.MemoryView":1179
19588  *
19589  * for i in range(ndim):
19590  * size *= src.shape[i] # <<<<<<<<<<<<<<
19591  *
19592  * return size
19593  */
19594  __pyx_v_size = (__pyx_v_size * (__pyx_v_src->shape[__pyx_v_i]));
19595  }
19596 
19597  /* "View.MemoryView":1181
19598  * size *= src.shape[i]
19599  *
19600  * return size # <<<<<<<<<<<<<<
19601  *
19602  * @cname('__pyx_fill_contig_strides_array')
19603  */
19604  __pyx_r = __pyx_v_size;
19605  goto __pyx_L0;
19606 
19607  /* "View.MemoryView":1173
19608  *
19609  * @cname('__pyx_memoryview_slice_get_size')
19610  * cdef Py_ssize_t slice_get_size(__Pyx_memviewslice *src, int ndim) nogil: # <<<<<<<<<<<<<<
19611  * "Return the size of the memory occupied by the slice in number of bytes"
19612  * cdef int i
19613  */
19614 
19615  /* function exit code */
19616  __pyx_L0:;
19617  return __pyx_r;
19618 }
19619 
19620 /* "View.MemoryView":1184
19621  *
19622  * @cname('__pyx_fill_contig_strides_array')
19623  * cdef Py_ssize_t fill_contig_strides_array( # <<<<<<<<<<<<<<
19624  * Py_ssize_t *shape, Py_ssize_t *strides, Py_ssize_t stride,
19625  * int ndim, char order) nogil:
19626  */
19627 
19628 static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides, Py_ssize_t __pyx_v_stride, int __pyx_v_ndim, char __pyx_v_order) {
19629  int __pyx_v_idx;
19630  Py_ssize_t __pyx_r;
19631  int __pyx_t_1;
19632  int __pyx_t_2;
19633  int __pyx_t_3;
19634  int __pyx_t_4;
19635 
19636  /* "View.MemoryView":1193
19637  * cdef int idx
19638  *
19639  * if order == 'F': # <<<<<<<<<<<<<<
19640  * for idx in range(ndim):
19641  * strides[idx] = stride
19642  */
19643  __pyx_t_1 = ((__pyx_v_order == 'F') != 0);
19644  if (__pyx_t_1) {
19645 
19646  /* "View.MemoryView":1194
19647  *
19648  * if order == 'F':
19649  * for idx in range(ndim): # <<<<<<<<<<<<<<
19650  * strides[idx] = stride
19651  * stride = stride * shape[idx]
19652  */
19653  __pyx_t_2 = __pyx_v_ndim;
19654  __pyx_t_3 = __pyx_t_2;
19655  for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
19656  __pyx_v_idx = __pyx_t_4;
19657 
19658  /* "View.MemoryView":1195
19659  * if order == 'F':
19660  * for idx in range(ndim):
19661  * strides[idx] = stride # <<<<<<<<<<<<<<
19662  * stride = stride * shape[idx]
19663  * else:
19664  */
19665  (__pyx_v_strides[__pyx_v_idx]) = __pyx_v_stride;
19666 
19667  /* "View.MemoryView":1196
19668  * for idx in range(ndim):
19669  * strides[idx] = stride
19670  * stride = stride * shape[idx] # <<<<<<<<<<<<<<
19671  * else:
19672  * for idx in range(ndim - 1, -1, -1):
19673  */
19674  __pyx_v_stride = (__pyx_v_stride * (__pyx_v_shape[__pyx_v_idx]));
19675  }
19676 
19677  /* "View.MemoryView":1193
19678  * cdef int idx
19679  *
19680  * if order == 'F': # <<<<<<<<<<<<<<
19681  * for idx in range(ndim):
19682  * strides[idx] = stride
19683  */
19684  goto __pyx_L3;
19685  }
19686 
19687  /* "View.MemoryView":1198
19688  * stride = stride * shape[idx]
19689  * else:
19690  * for idx in range(ndim - 1, -1, -1): # <<<<<<<<<<<<<<
19691  * strides[idx] = stride
19692  * stride = stride * shape[idx]
19693  */
19694  /*else*/ {
19695  for (__pyx_t_2 = (__pyx_v_ndim - 1); __pyx_t_2 > -1; __pyx_t_2-=1) {
19696  __pyx_v_idx = __pyx_t_2;
19697 
19698  /* "View.MemoryView":1199
19699  * else:
19700  * for idx in range(ndim - 1, -1, -1):
19701  * strides[idx] = stride # <<<<<<<<<<<<<<
19702  * stride = stride * shape[idx]
19703  *
19704  */
19705  (__pyx_v_strides[__pyx_v_idx]) = __pyx_v_stride;
19706 
19707  /* "View.MemoryView":1200
19708  * for idx in range(ndim - 1, -1, -1):
19709  * strides[idx] = stride
19710  * stride = stride * shape[idx] # <<<<<<<<<<<<<<
19711  *
19712  * return stride
19713  */
19714  __pyx_v_stride = (__pyx_v_stride * (__pyx_v_shape[__pyx_v_idx]));
19715  }
19716  }
19717  __pyx_L3:;
19718 
19719  /* "View.MemoryView":1202
19720  * stride = stride * shape[idx]
19721  *
19722  * return stride # <<<<<<<<<<<<<<
19723  *
19724  * @cname('__pyx_memoryview_copy_data_to_temp')
19725  */
19726  __pyx_r = __pyx_v_stride;
19727  goto __pyx_L0;
19728 
19729  /* "View.MemoryView":1184
19730  *
19731  * @cname('__pyx_fill_contig_strides_array')
19732  * cdef Py_ssize_t fill_contig_strides_array( # <<<<<<<<<<<<<<
19733  * Py_ssize_t *shape, Py_ssize_t *strides, Py_ssize_t stride,
19734  * int ndim, char order) nogil:
19735  */
19736 
19737  /* function exit code */
19738  __pyx_L0:;
19739  return __pyx_r;
19740 }
19741 
19742 /* "View.MemoryView":1205
19743  *
19744  * @cname('__pyx_memoryview_copy_data_to_temp')
19745  * cdef void *copy_data_to_temp(__Pyx_memviewslice *src, # <<<<<<<<<<<<<<
19746  * __Pyx_memviewslice *tmpslice,
19747  * char order,
19748  */
19749 
19750 static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src, __Pyx_memviewslice *__pyx_v_tmpslice, char __pyx_v_order, int __pyx_v_ndim) {
19751  int __pyx_v_i;
19752  void *__pyx_v_result;
19753  size_t __pyx_v_itemsize;
19754  size_t __pyx_v_size;
19755  void *__pyx_r;
19756  Py_ssize_t __pyx_t_1;
19757  int __pyx_t_2;
19758  int __pyx_t_3;
19759  struct __pyx_memoryview_obj *__pyx_t_4;
19760  int __pyx_t_5;
19761  int __pyx_t_6;
19762 
19763  /* "View.MemoryView":1216
19764  * cdef void *result
19765  *
19766  * cdef size_t itemsize = src.memview.view.itemsize # <<<<<<<<<<<<<<
19767  * cdef size_t size = slice_get_size(src, ndim)
19768  *
19769  */
19770  __pyx_t_1 = __pyx_v_src->memview->view.itemsize;
19771  __pyx_v_itemsize = __pyx_t_1;
19772 
19773  /* "View.MemoryView":1217
19774  *
19775  * cdef size_t itemsize = src.memview.view.itemsize
19776  * cdef size_t size = slice_get_size(src, ndim) # <<<<<<<<<<<<<<
19777  *
19778  * result = malloc(size)
19779  */
19780  __pyx_v_size = __pyx_memoryview_slice_get_size(__pyx_v_src, __pyx_v_ndim);
19781 
19782  /* "View.MemoryView":1219
19783  * cdef size_t size = slice_get_size(src, ndim)
19784  *
19785  * result = malloc(size) # <<<<<<<<<<<<<<
19786  * if not result:
19787  * _err(MemoryError, NULL)
19788  */
19789  __pyx_v_result = malloc(__pyx_v_size);
19790 
19791  /* "View.MemoryView":1220
19792  *
19793  * result = malloc(size)
19794  * if not result: # <<<<<<<<<<<<<<
19795  * _err(MemoryError, NULL)
19796  *
19797  */
19798  __pyx_t_2 = ((!(__pyx_v_result != 0)) != 0);
19799  if (__pyx_t_2) {
19800 
19801  /* "View.MemoryView":1221
19802  * result = malloc(size)
19803  * if not result:
19804  * _err(MemoryError, NULL) # <<<<<<<<<<<<<<
19805  *
19806  *
19807  */
19808  __pyx_t_3 = __pyx_memoryview_err(__pyx_builtin_MemoryError, NULL); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(2, 1221, __pyx_L1_error)
19809 
19810  /* "View.MemoryView":1220
19811  *
19812  * result = malloc(size)
19813  * if not result: # <<<<<<<<<<<<<<
19814  * _err(MemoryError, NULL)
19815  *
19816  */
19817  }
19818 
19819  /* "View.MemoryView":1224
19820  *
19821  *
19822  * tmpslice.data = <char *> result # <<<<<<<<<<<<<<
19823  * tmpslice.memview = src.memview
19824  * for i in range(ndim):
19825  */
19826  __pyx_v_tmpslice->data = ((char *)__pyx_v_result);
19827 
19828  /* "View.MemoryView":1225
19829  *
19830  * tmpslice.data = <char *> result
19831  * tmpslice.memview = src.memview # <<<<<<<<<<<<<<
19832  * for i in range(ndim):
19833  * tmpslice.shape[i] = src.shape[i]
19834  */
19835  __pyx_t_4 = __pyx_v_src->memview;
19836  __pyx_v_tmpslice->memview = __pyx_t_4;
19837 
19838  /* "View.MemoryView":1226
19839  * tmpslice.data = <char *> result
19840  * tmpslice.memview = src.memview
19841  * for i in range(ndim): # <<<<<<<<<<<<<<
19842  * tmpslice.shape[i] = src.shape[i]
19843  * tmpslice.suboffsets[i] = -1
19844  */
19845  __pyx_t_3 = __pyx_v_ndim;
19846  __pyx_t_5 = __pyx_t_3;
19847  for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
19848  __pyx_v_i = __pyx_t_6;
19849 
19850  /* "View.MemoryView":1227
19851  * tmpslice.memview = src.memview
19852  * for i in range(ndim):
19853  * tmpslice.shape[i] = src.shape[i] # <<<<<<<<<<<<<<
19854  * tmpslice.suboffsets[i] = -1
19855  *
19856  */
19857  (__pyx_v_tmpslice->shape[__pyx_v_i]) = (__pyx_v_src->shape[__pyx_v_i]);
19858 
19859  /* "View.MemoryView":1228
19860  * for i in range(ndim):
19861  * tmpslice.shape[i] = src.shape[i]
19862  * tmpslice.suboffsets[i] = -1 # <<<<<<<<<<<<<<
19863  *
19864  * fill_contig_strides_array(&tmpslice.shape[0], &tmpslice.strides[0], itemsize,
19865  */
19866  (__pyx_v_tmpslice->suboffsets[__pyx_v_i]) = -1L;
19867  }
19868 
19869  /* "View.MemoryView":1230
19870  * tmpslice.suboffsets[i] = -1
19871  *
19872  * fill_contig_strides_array(&tmpslice.shape[0], &tmpslice.strides[0], itemsize, # <<<<<<<<<<<<<<
19873  * ndim, order)
19874  *
19875  */
19876  (void)(__pyx_fill_contig_strides_array((&(__pyx_v_tmpslice->shape[0])), (&(__pyx_v_tmpslice->strides[0])), __pyx_v_itemsize, __pyx_v_ndim, __pyx_v_order));
19877 
19878  /* "View.MemoryView":1234
19879  *
19880  *
19881  * for i in range(ndim): # <<<<<<<<<<<<<<
19882  * if tmpslice.shape[i] == 1:
19883  * tmpslice.strides[i] = 0
19884  */
19885  __pyx_t_3 = __pyx_v_ndim;
19886  __pyx_t_5 = __pyx_t_3;
19887  for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
19888  __pyx_v_i = __pyx_t_6;
19889 
19890  /* "View.MemoryView":1235
19891  *
19892  * for i in range(ndim):
19893  * if tmpslice.shape[i] == 1: # <<<<<<<<<<<<<<
19894  * tmpslice.strides[i] = 0
19895  *
19896  */
19897  __pyx_t_2 = (((__pyx_v_tmpslice->shape[__pyx_v_i]) == 1) != 0);
19898  if (__pyx_t_2) {
19899 
19900  /* "View.MemoryView":1236
19901  * for i in range(ndim):
19902  * if tmpslice.shape[i] == 1:
19903  * tmpslice.strides[i] = 0 # <<<<<<<<<<<<<<
19904  *
19905  * if slice_is_contig(src[0], order, ndim):
19906  */
19907  (__pyx_v_tmpslice->strides[__pyx_v_i]) = 0;
19908 
19909  /* "View.MemoryView":1235
19910  *
19911  * for i in range(ndim):
19912  * if tmpslice.shape[i] == 1: # <<<<<<<<<<<<<<
19913  * tmpslice.strides[i] = 0
19914  *
19915  */
19916  }
19917  }
19918 
19919  /* "View.MemoryView":1238
19920  * tmpslice.strides[i] = 0
19921  *
19922  * if slice_is_contig(src[0], order, ndim): # <<<<<<<<<<<<<<
19923  * memcpy(result, src.data, size)
19924  * else:
19925  */
19926  __pyx_t_2 = (__pyx_memviewslice_is_contig((__pyx_v_src[0]), __pyx_v_order, __pyx_v_ndim) != 0);
19927  if (__pyx_t_2) {
19928 
19929  /* "View.MemoryView":1239
19930  *
19931  * if slice_is_contig(src[0], order, ndim):
19932  * memcpy(result, src.data, size) # <<<<<<<<<<<<<<
19933  * else:
19934  * copy_strided_to_strided(src, tmpslice, ndim, itemsize)
19935  */
19936  (void)(memcpy(__pyx_v_result, __pyx_v_src->data, __pyx_v_size));
19937 
19938  /* "View.MemoryView":1238
19939  * tmpslice.strides[i] = 0
19940  *
19941  * if slice_is_contig(src[0], order, ndim): # <<<<<<<<<<<<<<
19942  * memcpy(result, src.data, size)
19943  * else:
19944  */
19945  goto __pyx_L9;
19946  }
19947 
19948  /* "View.MemoryView":1241
19949  * memcpy(result, src.data, size)
19950  * else:
19951  * copy_strided_to_strided(src, tmpslice, ndim, itemsize) # <<<<<<<<<<<<<<
19952  *
19953  * return result
19954  */
19955  /*else*/ {
19956  copy_strided_to_strided(__pyx_v_src, __pyx_v_tmpslice, __pyx_v_ndim, __pyx_v_itemsize);
19957  }
19958  __pyx_L9:;
19959 
19960  /* "View.MemoryView":1243
19961  * copy_strided_to_strided(src, tmpslice, ndim, itemsize)
19962  *
19963  * return result # <<<<<<<<<<<<<<
19964  *
19965  *
19966  */
19967  __pyx_r = __pyx_v_result;
19968  goto __pyx_L0;
19969 
19970  /* "View.MemoryView":1205
19971  *
19972  * @cname('__pyx_memoryview_copy_data_to_temp')
19973  * cdef void *copy_data_to_temp(__Pyx_memviewslice *src, # <<<<<<<<<<<<<<
19974  * __Pyx_memviewslice *tmpslice,
19975  * char order,
19976  */
19977 
19978  /* function exit code */
19979  __pyx_L1_error:;
19980  {
19981  #ifdef WITH_THREAD
19982  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
19983  #endif
19984  __Pyx_AddTraceback("View.MemoryView.copy_data_to_temp", __pyx_clineno, __pyx_lineno, __pyx_filename);
19985  #ifdef WITH_THREAD
19986  __Pyx_PyGILState_Release(__pyx_gilstate_save);
19987  #endif
19988  }
19989  __pyx_r = NULL;
19990  __pyx_L0:;
19991  return __pyx_r;
19992 }
19993 
19994 /* "View.MemoryView":1248
19995  *
19996  * @cname('__pyx_memoryview_err_extents')
19997  * cdef int _err_extents(int i, Py_ssize_t extent1, # <<<<<<<<<<<<<<
19998  * Py_ssize_t extent2) except -1 with gil:
19999  * raise ValueError("got differing extents in dimension %d (got %d and %d)" %
20000  */
20001 
20002 static int __pyx_memoryview_err_extents(int __pyx_v_i, Py_ssize_t __pyx_v_extent1, Py_ssize_t __pyx_v_extent2) {
20003  int __pyx_r;
20004  __Pyx_RefNannyDeclarations
20005  PyObject *__pyx_t_1 = NULL;
20006  PyObject *__pyx_t_2 = NULL;
20007  PyObject *__pyx_t_3 = NULL;
20008  PyObject *__pyx_t_4 = NULL;
20009  #ifdef WITH_THREAD
20010  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
20011  #endif
20012  __Pyx_RefNannySetupContext("_err_extents", 0);
20013 
20014  /* "View.MemoryView":1251
20015  * Py_ssize_t extent2) except -1 with gil:
20016  * raise ValueError("got differing extents in dimension %d (got %d and %d)" %
20017  * (i, extent1, extent2)) # <<<<<<<<<<<<<<
20018  *
20019  * @cname('__pyx_memoryview_err_dim')
20020  */
20021  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_i); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 1251, __pyx_L1_error)
20022  __Pyx_GOTREF(__pyx_t_1);
20023  __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_extent1); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1251, __pyx_L1_error)
20024  __Pyx_GOTREF(__pyx_t_2);
20025  __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_extent2); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 1251, __pyx_L1_error)
20026  __Pyx_GOTREF(__pyx_t_3);
20027  __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 1251, __pyx_L1_error)
20028  __Pyx_GOTREF(__pyx_t_4);
20029  __Pyx_GIVEREF(__pyx_t_1);
20030  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
20031  __Pyx_GIVEREF(__pyx_t_2);
20032  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2);
20033  __Pyx_GIVEREF(__pyx_t_3);
20034  PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_3);
20035  __pyx_t_1 = 0;
20036  __pyx_t_2 = 0;
20037  __pyx_t_3 = 0;
20038 
20039  /* "View.MemoryView":1250
20040  * cdef int _err_extents(int i, Py_ssize_t extent1,
20041  * Py_ssize_t extent2) except -1 with gil:
20042  * raise ValueError("got differing extents in dimension %d (got %d and %d)" % # <<<<<<<<<<<<<<
20043  * (i, extent1, extent2))
20044  *
20045  */
20046  __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_got_differing_extents_in_dimensi, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 1250, __pyx_L1_error)
20047  __Pyx_GOTREF(__pyx_t_3);
20048  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
20049  __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 1250, __pyx_L1_error)
20050  __Pyx_GOTREF(__pyx_t_4);
20051  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
20052  __Pyx_Raise(__pyx_t_4, 0, 0, 0);
20053  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
20054  __PYX_ERR(2, 1250, __pyx_L1_error)
20055 
20056  /* "View.MemoryView":1248
20057  *
20058  * @cname('__pyx_memoryview_err_extents')
20059  * cdef int _err_extents(int i, Py_ssize_t extent1, # <<<<<<<<<<<<<<
20060  * Py_ssize_t extent2) except -1 with gil:
20061  * raise ValueError("got differing extents in dimension %d (got %d and %d)" %
20062  */
20063 
20064  /* function exit code */
20065  __pyx_L1_error:;
20066  __Pyx_XDECREF(__pyx_t_1);
20067  __Pyx_XDECREF(__pyx_t_2);
20068  __Pyx_XDECREF(__pyx_t_3);
20069  __Pyx_XDECREF(__pyx_t_4);
20070  __Pyx_AddTraceback("View.MemoryView._err_extents", __pyx_clineno, __pyx_lineno, __pyx_filename);
20071  __pyx_r = -1;
20072  __Pyx_RefNannyFinishContext();
20073  #ifdef WITH_THREAD
20074  __Pyx_PyGILState_Release(__pyx_gilstate_save);
20075  #endif
20076  return __pyx_r;
20077 }
20078 
20079 /* "View.MemoryView":1254
20080  *
20081  * @cname('__pyx_memoryview_err_dim')
20082  * cdef int _err_dim(object error, char *msg, int dim) except -1 with gil: # <<<<<<<<<<<<<<
20083  * raise error(msg.decode('ascii') % dim)
20084  *
20085  */
20086 
20087 static int __pyx_memoryview_err_dim(PyObject *__pyx_v_error, char *__pyx_v_msg, int __pyx_v_dim) {
20088  int __pyx_r;
20089  __Pyx_RefNannyDeclarations
20090  PyObject *__pyx_t_1 = NULL;
20091  PyObject *__pyx_t_2 = NULL;
20092  PyObject *__pyx_t_3 = NULL;
20093  PyObject *__pyx_t_4 = NULL;
20094  #ifdef WITH_THREAD
20095  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
20096  #endif
20097  __Pyx_RefNannySetupContext("_err_dim", 0);
20098  __Pyx_INCREF(__pyx_v_error);
20099 
20100  /* "View.MemoryView":1255
20101  * @cname('__pyx_memoryview_err_dim')
20102  * cdef int _err_dim(object error, char *msg, int dim) except -1 with gil:
20103  * raise error(msg.decode('ascii') % dim) # <<<<<<<<<<<<<<
20104  *
20105  * @cname('__pyx_memoryview_err')
20106  */
20107  __pyx_t_2 = __Pyx_decode_c_string(__pyx_v_msg, 0, strlen(__pyx_v_msg), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1255, __pyx_L1_error)
20108  __Pyx_GOTREF(__pyx_t_2);
20109  __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_dim); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 1255, __pyx_L1_error)
20110  __Pyx_GOTREF(__pyx_t_3);
20111  __pyx_t_4 = PyUnicode_Format(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 1255, __pyx_L1_error)
20112  __Pyx_GOTREF(__pyx_t_4);
20113  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
20114  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
20115  __Pyx_INCREF(__pyx_v_error);
20116  __pyx_t_3 = __pyx_v_error; __pyx_t_2 = NULL;
20117  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
20118  __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
20119  if (likely(__pyx_t_2)) {
20120  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
20121  __Pyx_INCREF(__pyx_t_2);
20122  __Pyx_INCREF(function);
20123  __Pyx_DECREF_SET(__pyx_t_3, function);
20124  }
20125  }
20126  __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_2, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4);
20127  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
20128  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
20129  if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 1255, __pyx_L1_error)
20130  __Pyx_GOTREF(__pyx_t_1);
20131  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
20132  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
20133  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
20134  __PYX_ERR(2, 1255, __pyx_L1_error)
20135 
20136  /* "View.MemoryView":1254
20137  *
20138  * @cname('__pyx_memoryview_err_dim')
20139  * cdef int _err_dim(object error, char *msg, int dim) except -1 with gil: # <<<<<<<<<<<<<<
20140  * raise error(msg.decode('ascii') % dim)
20141  *
20142  */
20143 
20144  /* function exit code */
20145  __pyx_L1_error:;
20146  __Pyx_XDECREF(__pyx_t_1);
20147  __Pyx_XDECREF(__pyx_t_2);
20148  __Pyx_XDECREF(__pyx_t_3);
20149  __Pyx_XDECREF(__pyx_t_4);
20150  __Pyx_AddTraceback("View.MemoryView._err_dim", __pyx_clineno, __pyx_lineno, __pyx_filename);
20151  __pyx_r = -1;
20152  __Pyx_XDECREF(__pyx_v_error);
20153  __Pyx_RefNannyFinishContext();
20154  #ifdef WITH_THREAD
20155  __Pyx_PyGILState_Release(__pyx_gilstate_save);
20156  #endif
20157  return __pyx_r;
20158 }
20159 
20160 /* "View.MemoryView":1258
20161  *
20162  * @cname('__pyx_memoryview_err')
20163  * cdef int _err(object error, char *msg) except -1 with gil: # <<<<<<<<<<<<<<
20164  * if msg != NULL:
20165  * raise error(msg.decode('ascii'))
20166  */
20167 
20168 static int __pyx_memoryview_err(PyObject *__pyx_v_error, char *__pyx_v_msg) {
20169  int __pyx_r;
20170  __Pyx_RefNannyDeclarations
20171  int __pyx_t_1;
20172  PyObject *__pyx_t_2 = NULL;
20173  PyObject *__pyx_t_3 = NULL;
20174  PyObject *__pyx_t_4 = NULL;
20175  PyObject *__pyx_t_5 = NULL;
20176  #ifdef WITH_THREAD
20177  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
20178  #endif
20179  __Pyx_RefNannySetupContext("_err", 0);
20180  __Pyx_INCREF(__pyx_v_error);
20181 
20182  /* "View.MemoryView":1259
20183  * @cname('__pyx_memoryview_err')
20184  * cdef int _err(object error, char *msg) except -1 with gil:
20185  * if msg != NULL: # <<<<<<<<<<<<<<
20186  * raise error(msg.decode('ascii'))
20187  * else:
20188  */
20189  __pyx_t_1 = ((__pyx_v_msg != NULL) != 0);
20190  if (unlikely(__pyx_t_1)) {
20191 
20192  /* "View.MemoryView":1260
20193  * cdef int _err(object error, char *msg) except -1 with gil:
20194  * if msg != NULL:
20195  * raise error(msg.decode('ascii')) # <<<<<<<<<<<<<<
20196  * else:
20197  * raise error
20198  */
20199  __pyx_t_3 = __Pyx_decode_c_string(__pyx_v_msg, 0, strlen(__pyx_v_msg), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 1260, __pyx_L1_error)
20200  __Pyx_GOTREF(__pyx_t_3);
20201  __Pyx_INCREF(__pyx_v_error);
20202  __pyx_t_4 = __pyx_v_error; __pyx_t_5 = NULL;
20203  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
20204  __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
20205  if (likely(__pyx_t_5)) {
20206  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
20207  __Pyx_INCREF(__pyx_t_5);
20208  __Pyx_INCREF(function);
20209  __Pyx_DECREF_SET(__pyx_t_4, function);
20210  }
20211  }
20212  __pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3);
20213  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
20214  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
20215  if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1260, __pyx_L1_error)
20216  __Pyx_GOTREF(__pyx_t_2);
20217  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
20218  __Pyx_Raise(__pyx_t_2, 0, 0, 0);
20219  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
20220  __PYX_ERR(2, 1260, __pyx_L1_error)
20221 
20222  /* "View.MemoryView":1259
20223  * @cname('__pyx_memoryview_err')
20224  * cdef int _err(object error, char *msg) except -1 with gil:
20225  * if msg != NULL: # <<<<<<<<<<<<<<
20226  * raise error(msg.decode('ascii'))
20227  * else:
20228  */
20229  }
20230 
20231  /* "View.MemoryView":1262
20232  * raise error(msg.decode('ascii'))
20233  * else:
20234  * raise error # <<<<<<<<<<<<<<
20235  *
20236  * @cname('__pyx_memoryview_copy_contents')
20237  */
20238  /*else*/ {
20239  __Pyx_Raise(__pyx_v_error, 0, 0, 0);
20240  __PYX_ERR(2, 1262, __pyx_L1_error)
20241  }
20242 
20243  /* "View.MemoryView":1258
20244  *
20245  * @cname('__pyx_memoryview_err')
20246  * cdef int _err(object error, char *msg) except -1 with gil: # <<<<<<<<<<<<<<
20247  * if msg != NULL:
20248  * raise error(msg.decode('ascii'))
20249  */
20250 
20251  /* function exit code */
20252  __pyx_L1_error:;
20253  __Pyx_XDECREF(__pyx_t_2);
20254  __Pyx_XDECREF(__pyx_t_3);
20255  __Pyx_XDECREF(__pyx_t_4);
20256  __Pyx_XDECREF(__pyx_t_5);
20257  __Pyx_AddTraceback("View.MemoryView._err", __pyx_clineno, __pyx_lineno, __pyx_filename);
20258  __pyx_r = -1;
20259  __Pyx_XDECREF(__pyx_v_error);
20260  __Pyx_RefNannyFinishContext();
20261  #ifdef WITH_THREAD
20262  __Pyx_PyGILState_Release(__pyx_gilstate_save);
20263  #endif
20264  return __pyx_r;
20265 }
20266 
20267 /* "View.MemoryView":1265
20268  *
20269  * @cname('__pyx_memoryview_copy_contents')
20270  * cdef int memoryview_copy_contents(__Pyx_memviewslice src, # <<<<<<<<<<<<<<
20271  * __Pyx_memviewslice dst,
20272  * int src_ndim, int dst_ndim,
20273  */
20274 
20275 static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_memviewslice __pyx_v_dst, int __pyx_v_src_ndim, int __pyx_v_dst_ndim, int __pyx_v_dtype_is_object) {
20276  void *__pyx_v_tmpdata;
20277  size_t __pyx_v_itemsize;
20278  int __pyx_v_i;
20279  char __pyx_v_order;
20280  int __pyx_v_broadcasting;
20281  int __pyx_v_direct_copy;
20282  __Pyx_memviewslice __pyx_v_tmp;
20283  int __pyx_v_ndim;
20284  int __pyx_r;
20285  Py_ssize_t __pyx_t_1;
20286  int __pyx_t_2;
20287  int __pyx_t_3;
20288  int __pyx_t_4;
20289  int __pyx_t_5;
20290  int __pyx_t_6;
20291  void *__pyx_t_7;
20292  int __pyx_t_8;
20293 
20294  /* "View.MemoryView":1273
20295  * Check for overlapping memory and verify the shapes.
20296  * """
20297  * cdef void *tmpdata = NULL # <<<<<<<<<<<<<<
20298  * cdef size_t itemsize = src.memview.view.itemsize
20299  * cdef int i
20300  */
20301  __pyx_v_tmpdata = NULL;
20302 
20303  /* "View.MemoryView":1274
20304  * """
20305  * cdef void *tmpdata = NULL
20306  * cdef size_t itemsize = src.memview.view.itemsize # <<<<<<<<<<<<<<
20307  * cdef int i
20308  * cdef char order = get_best_order(&src, src_ndim)
20309  */
20310  __pyx_t_1 = __pyx_v_src.memview->view.itemsize;
20311  __pyx_v_itemsize = __pyx_t_1;
20312 
20313  /* "View.MemoryView":1276
20314  * cdef size_t itemsize = src.memview.view.itemsize
20315  * cdef int i
20316  * cdef char order = get_best_order(&src, src_ndim) # <<<<<<<<<<<<<<
20317  * cdef bint broadcasting = False
20318  * cdef bint direct_copy = False
20319  */
20320  __pyx_v_order = __pyx_get_best_slice_order((&__pyx_v_src), __pyx_v_src_ndim);
20321 
20322  /* "View.MemoryView":1277
20323  * cdef int i
20324  * cdef char order = get_best_order(&src, src_ndim)
20325  * cdef bint broadcasting = False # <<<<<<<<<<<<<<
20326  * cdef bint direct_copy = False
20327  * cdef __Pyx_memviewslice tmp
20328  */
20329  __pyx_v_broadcasting = 0;
20330 
20331  /* "View.MemoryView":1278
20332  * cdef char order = get_best_order(&src, src_ndim)
20333  * cdef bint broadcasting = False
20334  * cdef bint direct_copy = False # <<<<<<<<<<<<<<
20335  * cdef __Pyx_memviewslice tmp
20336  *
20337  */
20338  __pyx_v_direct_copy = 0;
20339 
20340  /* "View.MemoryView":1281
20341  * cdef __Pyx_memviewslice tmp
20342  *
20343  * if src_ndim < dst_ndim: # <<<<<<<<<<<<<<
20344  * broadcast_leading(&src, src_ndim, dst_ndim)
20345  * elif dst_ndim < src_ndim:
20346  */
20347  __pyx_t_2 = ((__pyx_v_src_ndim < __pyx_v_dst_ndim) != 0);
20348  if (__pyx_t_2) {
20349 
20350  /* "View.MemoryView":1282
20351  *
20352  * if src_ndim < dst_ndim:
20353  * broadcast_leading(&src, src_ndim, dst_ndim) # <<<<<<<<<<<<<<
20354  * elif dst_ndim < src_ndim:
20355  * broadcast_leading(&dst, dst_ndim, src_ndim)
20356  */
20357  __pyx_memoryview_broadcast_leading((&__pyx_v_src), __pyx_v_src_ndim, __pyx_v_dst_ndim);
20358 
20359  /* "View.MemoryView":1281
20360  * cdef __Pyx_memviewslice tmp
20361  *
20362  * if src_ndim < dst_ndim: # <<<<<<<<<<<<<<
20363  * broadcast_leading(&src, src_ndim, dst_ndim)
20364  * elif dst_ndim < src_ndim:
20365  */
20366  goto __pyx_L3;
20367  }
20368 
20369  /* "View.MemoryView":1283
20370  * if src_ndim < dst_ndim:
20371  * broadcast_leading(&src, src_ndim, dst_ndim)
20372  * elif dst_ndim < src_ndim: # <<<<<<<<<<<<<<
20373  * broadcast_leading(&dst, dst_ndim, src_ndim)
20374  *
20375  */
20376  __pyx_t_2 = ((__pyx_v_dst_ndim < __pyx_v_src_ndim) != 0);
20377  if (__pyx_t_2) {
20378 
20379  /* "View.MemoryView":1284
20380  * broadcast_leading(&src, src_ndim, dst_ndim)
20381  * elif dst_ndim < src_ndim:
20382  * broadcast_leading(&dst, dst_ndim, src_ndim) # <<<<<<<<<<<<<<
20383  *
20384  * cdef int ndim = max(src_ndim, dst_ndim)
20385  */
20386  __pyx_memoryview_broadcast_leading((&__pyx_v_dst), __pyx_v_dst_ndim, __pyx_v_src_ndim);
20387 
20388  /* "View.MemoryView":1283
20389  * if src_ndim < dst_ndim:
20390  * broadcast_leading(&src, src_ndim, dst_ndim)
20391  * elif dst_ndim < src_ndim: # <<<<<<<<<<<<<<
20392  * broadcast_leading(&dst, dst_ndim, src_ndim)
20393  *
20394  */
20395  }
20396  __pyx_L3:;
20397 
20398  /* "View.MemoryView":1286
20399  * broadcast_leading(&dst, dst_ndim, src_ndim)
20400  *
20401  * cdef int ndim = max(src_ndim, dst_ndim) # <<<<<<<<<<<<<<
20402  *
20403  * for i in range(ndim):
20404  */
20405  __pyx_t_3 = __pyx_v_dst_ndim;
20406  __pyx_t_4 = __pyx_v_src_ndim;
20407  if (((__pyx_t_3 > __pyx_t_4) != 0)) {
20408  __pyx_t_5 = __pyx_t_3;
20409  } else {
20410  __pyx_t_5 = __pyx_t_4;
20411  }
20412  __pyx_v_ndim = __pyx_t_5;
20413 
20414  /* "View.MemoryView":1288
20415  * cdef int ndim = max(src_ndim, dst_ndim)
20416  *
20417  * for i in range(ndim): # <<<<<<<<<<<<<<
20418  * if src.shape[i] != dst.shape[i]:
20419  * if src.shape[i] == 1:
20420  */
20421  __pyx_t_5 = __pyx_v_ndim;
20422  __pyx_t_3 = __pyx_t_5;
20423  for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
20424  __pyx_v_i = __pyx_t_4;
20425 
20426  /* "View.MemoryView":1289
20427  *
20428  * for i in range(ndim):
20429  * if src.shape[i] != dst.shape[i]: # <<<<<<<<<<<<<<
20430  * if src.shape[i] == 1:
20431  * broadcasting = True
20432  */
20433  __pyx_t_2 = (((__pyx_v_src.shape[__pyx_v_i]) != (__pyx_v_dst.shape[__pyx_v_i])) != 0);
20434  if (__pyx_t_2) {
20435 
20436  /* "View.MemoryView":1290
20437  * for i in range(ndim):
20438  * if src.shape[i] != dst.shape[i]:
20439  * if src.shape[i] == 1: # <<<<<<<<<<<<<<
20440  * broadcasting = True
20441  * src.strides[i] = 0
20442  */
20443  __pyx_t_2 = (((__pyx_v_src.shape[__pyx_v_i]) == 1) != 0);
20444  if (__pyx_t_2) {
20445 
20446  /* "View.MemoryView":1291
20447  * if src.shape[i] != dst.shape[i]:
20448  * if src.shape[i] == 1:
20449  * broadcasting = True # <<<<<<<<<<<<<<
20450  * src.strides[i] = 0
20451  * else:
20452  */
20453  __pyx_v_broadcasting = 1;
20454 
20455  /* "View.MemoryView":1292
20456  * if src.shape[i] == 1:
20457  * broadcasting = True
20458  * src.strides[i] = 0 # <<<<<<<<<<<<<<
20459  * else:
20460  * _err_extents(i, dst.shape[i], src.shape[i])
20461  */
20462  (__pyx_v_src.strides[__pyx_v_i]) = 0;
20463 
20464  /* "View.MemoryView":1290
20465  * for i in range(ndim):
20466  * if src.shape[i] != dst.shape[i]:
20467  * if src.shape[i] == 1: # <<<<<<<<<<<<<<
20468  * broadcasting = True
20469  * src.strides[i] = 0
20470  */
20471  goto __pyx_L7;
20472  }
20473 
20474  /* "View.MemoryView":1294
20475  * src.strides[i] = 0
20476  * else:
20477  * _err_extents(i, dst.shape[i], src.shape[i]) # <<<<<<<<<<<<<<
20478  *
20479  * if src.suboffsets[i] >= 0:
20480  */
20481  /*else*/ {
20482  __pyx_t_6 = __pyx_memoryview_err_extents(__pyx_v_i, (__pyx_v_dst.shape[__pyx_v_i]), (__pyx_v_src.shape[__pyx_v_i])); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(2, 1294, __pyx_L1_error)
20483  }
20484  __pyx_L7:;
20485 
20486  /* "View.MemoryView":1289
20487  *
20488  * for i in range(ndim):
20489  * if src.shape[i] != dst.shape[i]: # <<<<<<<<<<<<<<
20490  * if src.shape[i] == 1:
20491  * broadcasting = True
20492  */
20493  }
20494 
20495  /* "View.MemoryView":1296
20496  * _err_extents(i, dst.shape[i], src.shape[i])
20497  *
20498  * if src.suboffsets[i] >= 0: # <<<<<<<<<<<<<<
20499  * _err_dim(ValueError, "Dimension %d is not direct", i)
20500  *
20501  */
20502  __pyx_t_2 = (((__pyx_v_src.suboffsets[__pyx_v_i]) >= 0) != 0);
20503  if (__pyx_t_2) {
20504 
20505  /* "View.MemoryView":1297
20506  *
20507  * if src.suboffsets[i] >= 0:
20508  * _err_dim(ValueError, "Dimension %d is not direct", i) # <<<<<<<<<<<<<<
20509  *
20510  * if slices_overlap(&src, &dst, ndim, itemsize):
20511  */
20512  __pyx_t_6 = __pyx_memoryview_err_dim(__pyx_builtin_ValueError, ((char *)"Dimension %d is not direct"), __pyx_v_i); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(2, 1297, __pyx_L1_error)
20513 
20514  /* "View.MemoryView":1296
20515  * _err_extents(i, dst.shape[i], src.shape[i])
20516  *
20517  * if src.suboffsets[i] >= 0: # <<<<<<<<<<<<<<
20518  * _err_dim(ValueError, "Dimension %d is not direct", i)
20519  *
20520  */
20521  }
20522  }
20523 
20524  /* "View.MemoryView":1299
20525  * _err_dim(ValueError, "Dimension %d is not direct", i)
20526  *
20527  * if slices_overlap(&src, &dst, ndim, itemsize): # <<<<<<<<<<<<<<
20528  *
20529  * if not slice_is_contig(src, order, ndim):
20530  */
20531  __pyx_t_2 = (__pyx_slices_overlap((&__pyx_v_src), (&__pyx_v_dst), __pyx_v_ndim, __pyx_v_itemsize) != 0);
20532  if (__pyx_t_2) {
20533 
20534  /* "View.MemoryView":1301
20535  * if slices_overlap(&src, &dst, ndim, itemsize):
20536  *
20537  * if not slice_is_contig(src, order, ndim): # <<<<<<<<<<<<<<
20538  * order = get_best_order(&dst, ndim)
20539  *
20540  */
20541  __pyx_t_2 = ((!(__pyx_memviewslice_is_contig(__pyx_v_src, __pyx_v_order, __pyx_v_ndim) != 0)) != 0);
20542  if (__pyx_t_2) {
20543 
20544  /* "View.MemoryView":1302
20545  *
20546  * if not slice_is_contig(src, order, ndim):
20547  * order = get_best_order(&dst, ndim) # <<<<<<<<<<<<<<
20548  *
20549  * tmpdata = copy_data_to_temp(&src, &tmp, order, ndim)
20550  */
20551  __pyx_v_order = __pyx_get_best_slice_order((&__pyx_v_dst), __pyx_v_ndim);
20552 
20553  /* "View.MemoryView":1301
20554  * if slices_overlap(&src, &dst, ndim, itemsize):
20555  *
20556  * if not slice_is_contig(src, order, ndim): # <<<<<<<<<<<<<<
20557  * order = get_best_order(&dst, ndim)
20558  *
20559  */
20560  }
20561 
20562  /* "View.MemoryView":1304
20563  * order = get_best_order(&dst, ndim)
20564  *
20565  * tmpdata = copy_data_to_temp(&src, &tmp, order, ndim) # <<<<<<<<<<<<<<
20566  * src = tmp
20567  *
20568  */
20569  __pyx_t_7 = __pyx_memoryview_copy_data_to_temp((&__pyx_v_src), (&__pyx_v_tmp), __pyx_v_order, __pyx_v_ndim); if (unlikely(__pyx_t_7 == ((void *)NULL))) __PYX_ERR(2, 1304, __pyx_L1_error)
20570  __pyx_v_tmpdata = __pyx_t_7;
20571 
20572  /* "View.MemoryView":1305
20573  *
20574  * tmpdata = copy_data_to_temp(&src, &tmp, order, ndim)
20575  * src = tmp # <<<<<<<<<<<<<<
20576  *
20577  * if not broadcasting:
20578  */
20579  __pyx_v_src = __pyx_v_tmp;
20580 
20581  /* "View.MemoryView":1299
20582  * _err_dim(ValueError, "Dimension %d is not direct", i)
20583  *
20584  * if slices_overlap(&src, &dst, ndim, itemsize): # <<<<<<<<<<<<<<
20585  *
20586  * if not slice_is_contig(src, order, ndim):
20587  */
20588  }
20589 
20590  /* "View.MemoryView":1307
20591  * src = tmp
20592  *
20593  * if not broadcasting: # <<<<<<<<<<<<<<
20594  *
20595  *
20596  */
20597  __pyx_t_2 = ((!(__pyx_v_broadcasting != 0)) != 0);
20598  if (__pyx_t_2) {
20599 
20600  /* "View.MemoryView":1310
20601  *
20602  *
20603  * if slice_is_contig(src, 'C', ndim): # <<<<<<<<<<<<<<
20604  * direct_copy = slice_is_contig(dst, 'C', ndim)
20605  * elif slice_is_contig(src, 'F', ndim):
20606  */
20607  __pyx_t_2 = (__pyx_memviewslice_is_contig(__pyx_v_src, 'C', __pyx_v_ndim) != 0);
20608  if (__pyx_t_2) {
20609 
20610  /* "View.MemoryView":1311
20611  *
20612  * if slice_is_contig(src, 'C', ndim):
20613  * direct_copy = slice_is_contig(dst, 'C', ndim) # <<<<<<<<<<<<<<
20614  * elif slice_is_contig(src, 'F', ndim):
20615  * direct_copy = slice_is_contig(dst, 'F', ndim)
20616  */
20617  __pyx_v_direct_copy = __pyx_memviewslice_is_contig(__pyx_v_dst, 'C', __pyx_v_ndim);
20618 
20619  /* "View.MemoryView":1310
20620  *
20621  *
20622  * if slice_is_contig(src, 'C', ndim): # <<<<<<<<<<<<<<
20623  * direct_copy = slice_is_contig(dst, 'C', ndim)
20624  * elif slice_is_contig(src, 'F', ndim):
20625  */
20626  goto __pyx_L12;
20627  }
20628 
20629  /* "View.MemoryView":1312
20630  * if slice_is_contig(src, 'C', ndim):
20631  * direct_copy = slice_is_contig(dst, 'C', ndim)
20632  * elif slice_is_contig(src, 'F', ndim): # <<<<<<<<<<<<<<
20633  * direct_copy = slice_is_contig(dst, 'F', ndim)
20634  *
20635  */
20636  __pyx_t_2 = (__pyx_memviewslice_is_contig(__pyx_v_src, 'F', __pyx_v_ndim) != 0);
20637  if (__pyx_t_2) {
20638 
20639  /* "View.MemoryView":1313
20640  * direct_copy = slice_is_contig(dst, 'C', ndim)
20641  * elif slice_is_contig(src, 'F', ndim):
20642  * direct_copy = slice_is_contig(dst, 'F', ndim) # <<<<<<<<<<<<<<
20643  *
20644  * if direct_copy:
20645  */
20646  __pyx_v_direct_copy = __pyx_memviewslice_is_contig(__pyx_v_dst, 'F', __pyx_v_ndim);
20647 
20648  /* "View.MemoryView":1312
20649  * if slice_is_contig(src, 'C', ndim):
20650  * direct_copy = slice_is_contig(dst, 'C', ndim)
20651  * elif slice_is_contig(src, 'F', ndim): # <<<<<<<<<<<<<<
20652  * direct_copy = slice_is_contig(dst, 'F', ndim)
20653  *
20654  */
20655  }
20656  __pyx_L12:;
20657 
20658  /* "View.MemoryView":1315
20659  * direct_copy = slice_is_contig(dst, 'F', ndim)
20660  *
20661  * if direct_copy: # <<<<<<<<<<<<<<
20662  *
20663  * refcount_copying(&dst, dtype_is_object, ndim, False)
20664  */
20665  __pyx_t_2 = (__pyx_v_direct_copy != 0);
20666  if (__pyx_t_2) {
20667 
20668  /* "View.MemoryView":1317
20669  * if direct_copy:
20670  *
20671  * refcount_copying(&dst, dtype_is_object, ndim, False) # <<<<<<<<<<<<<<
20672  * memcpy(dst.data, src.data, slice_get_size(&src, ndim))
20673  * refcount_copying(&dst, dtype_is_object, ndim, True)
20674  */
20675  __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 0);
20676 
20677  /* "View.MemoryView":1318
20678  *
20679  * refcount_copying(&dst, dtype_is_object, ndim, False)
20680  * memcpy(dst.data, src.data, slice_get_size(&src, ndim)) # <<<<<<<<<<<<<<
20681  * refcount_copying(&dst, dtype_is_object, ndim, True)
20682  * free(tmpdata)
20683  */
20684  (void)(memcpy(__pyx_v_dst.data, __pyx_v_src.data, __pyx_memoryview_slice_get_size((&__pyx_v_src), __pyx_v_ndim)));
20685 
20686  /* "View.MemoryView":1319
20687  * refcount_copying(&dst, dtype_is_object, ndim, False)
20688  * memcpy(dst.data, src.data, slice_get_size(&src, ndim))
20689  * refcount_copying(&dst, dtype_is_object, ndim, True) # <<<<<<<<<<<<<<
20690  * free(tmpdata)
20691  * return 0
20692  */
20693  __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 1);
20694 
20695  /* "View.MemoryView":1320
20696  * memcpy(dst.data, src.data, slice_get_size(&src, ndim))
20697  * refcount_copying(&dst, dtype_is_object, ndim, True)
20698  * free(tmpdata) # <<<<<<<<<<<<<<
20699  * return 0
20700  *
20701  */
20702  free(__pyx_v_tmpdata);
20703 
20704  /* "View.MemoryView":1321
20705  * refcount_copying(&dst, dtype_is_object, ndim, True)
20706  * free(tmpdata)
20707  * return 0 # <<<<<<<<<<<<<<
20708  *
20709  * if order == 'F' == get_best_order(&dst, ndim):
20710  */
20711  __pyx_r = 0;
20712  goto __pyx_L0;
20713 
20714  /* "View.MemoryView":1315
20715  * direct_copy = slice_is_contig(dst, 'F', ndim)
20716  *
20717  * if direct_copy: # <<<<<<<<<<<<<<
20718  *
20719  * refcount_copying(&dst, dtype_is_object, ndim, False)
20720  */
20721  }
20722 
20723  /* "View.MemoryView":1307
20724  * src = tmp
20725  *
20726  * if not broadcasting: # <<<<<<<<<<<<<<
20727  *
20728  *
20729  */
20730  }
20731 
20732  /* "View.MemoryView":1323
20733  * return 0
20734  *
20735  * if order == 'F' == get_best_order(&dst, ndim): # <<<<<<<<<<<<<<
20736  *
20737  *
20738  */
20739  __pyx_t_2 = (__pyx_v_order == 'F');
20740  if (__pyx_t_2) {
20741  __pyx_t_2 = ('F' == __pyx_get_best_slice_order((&__pyx_v_dst), __pyx_v_ndim));
20742  }
20743  __pyx_t_8 = (__pyx_t_2 != 0);
20744  if (__pyx_t_8) {
20745 
20746  /* "View.MemoryView":1326
20747  *
20748  *
20749  * transpose_memslice(&src) # <<<<<<<<<<<<<<
20750  * transpose_memslice(&dst)
20751  *
20752  */
20753  __pyx_t_5 = __pyx_memslice_transpose((&__pyx_v_src)); if (unlikely(__pyx_t_5 == ((int)0))) __PYX_ERR(2, 1326, __pyx_L1_error)
20754 
20755  /* "View.MemoryView":1327
20756  *
20757  * transpose_memslice(&src)
20758  * transpose_memslice(&dst) # <<<<<<<<<<<<<<
20759  *
20760  * refcount_copying(&dst, dtype_is_object, ndim, False)
20761  */
20762  __pyx_t_5 = __pyx_memslice_transpose((&__pyx_v_dst)); if (unlikely(__pyx_t_5 == ((int)0))) __PYX_ERR(2, 1327, __pyx_L1_error)
20763 
20764  /* "View.MemoryView":1323
20765  * return 0
20766  *
20767  * if order == 'F' == get_best_order(&dst, ndim): # <<<<<<<<<<<<<<
20768  *
20769  *
20770  */
20771  }
20772 
20773  /* "View.MemoryView":1329
20774  * transpose_memslice(&dst)
20775  *
20776  * refcount_copying(&dst, dtype_is_object, ndim, False) # <<<<<<<<<<<<<<
20777  * copy_strided_to_strided(&src, &dst, ndim, itemsize)
20778  * refcount_copying(&dst, dtype_is_object, ndim, True)
20779  */
20780  __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 0);
20781 
20782  /* "View.MemoryView":1330
20783  *
20784  * refcount_copying(&dst, dtype_is_object, ndim, False)
20785  * copy_strided_to_strided(&src, &dst, ndim, itemsize) # <<<<<<<<<<<<<<
20786  * refcount_copying(&dst, dtype_is_object, ndim, True)
20787  *
20788  */
20789  copy_strided_to_strided((&__pyx_v_src), (&__pyx_v_dst), __pyx_v_ndim, __pyx_v_itemsize);
20790 
20791  /* "View.MemoryView":1331
20792  * refcount_copying(&dst, dtype_is_object, ndim, False)
20793  * copy_strided_to_strided(&src, &dst, ndim, itemsize)
20794  * refcount_copying(&dst, dtype_is_object, ndim, True) # <<<<<<<<<<<<<<
20795  *
20796  * free(tmpdata)
20797  */
20798  __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 1);
20799 
20800  /* "View.MemoryView":1333
20801  * refcount_copying(&dst, dtype_is_object, ndim, True)
20802  *
20803  * free(tmpdata) # <<<<<<<<<<<<<<
20804  * return 0
20805  *
20806  */
20807  free(__pyx_v_tmpdata);
20808 
20809  /* "View.MemoryView":1334
20810  *
20811  * free(tmpdata)
20812  * return 0 # <<<<<<<<<<<<<<
20813  *
20814  * @cname('__pyx_memoryview_broadcast_leading')
20815  */
20816  __pyx_r = 0;
20817  goto __pyx_L0;
20818 
20819  /* "View.MemoryView":1265
20820  *
20821  * @cname('__pyx_memoryview_copy_contents')
20822  * cdef int memoryview_copy_contents(__Pyx_memviewslice src, # <<<<<<<<<<<<<<
20823  * __Pyx_memviewslice dst,
20824  * int src_ndim, int dst_ndim,
20825  */
20826 
20827  /* function exit code */
20828  __pyx_L1_error:;
20829  {
20830  #ifdef WITH_THREAD
20831  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
20832  #endif
20833  __Pyx_AddTraceback("View.MemoryView.memoryview_copy_contents", __pyx_clineno, __pyx_lineno, __pyx_filename);
20834  #ifdef WITH_THREAD
20835  __Pyx_PyGILState_Release(__pyx_gilstate_save);
20836  #endif
20837  }
20838  __pyx_r = -1;
20839  __pyx_L0:;
20840  return __pyx_r;
20841 }
20842 
20843 /* "View.MemoryView":1337
20844  *
20845  * @cname('__pyx_memoryview_broadcast_leading')
20846  * cdef void broadcast_leading(__Pyx_memviewslice *mslice, # <<<<<<<<<<<<<<
20847  * int ndim,
20848  * int ndim_other) nogil:
20849  */
20850 
20851 static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *__pyx_v_mslice, int __pyx_v_ndim, int __pyx_v_ndim_other) {
20852  int __pyx_v_i;
20853  int __pyx_v_offset;
20854  int __pyx_t_1;
20855  int __pyx_t_2;
20856  int __pyx_t_3;
20857 
20858  /* "View.MemoryView":1341
20859  * int ndim_other) nogil:
20860  * cdef int i
20861  * cdef int offset = ndim_other - ndim # <<<<<<<<<<<<<<
20862  *
20863  * for i in range(ndim - 1, -1, -1):
20864  */
20865  __pyx_v_offset = (__pyx_v_ndim_other - __pyx_v_ndim);
20866 
20867  /* "View.MemoryView":1343
20868  * cdef int offset = ndim_other - ndim
20869  *
20870  * for i in range(ndim - 1, -1, -1): # <<<<<<<<<<<<<<
20871  * mslice.shape[i + offset] = mslice.shape[i]
20872  * mslice.strides[i + offset] = mslice.strides[i]
20873  */
20874  for (__pyx_t_1 = (__pyx_v_ndim - 1); __pyx_t_1 > -1; __pyx_t_1-=1) {
20875  __pyx_v_i = __pyx_t_1;
20876 
20877  /* "View.MemoryView":1344
20878  *
20879  * for i in range(ndim - 1, -1, -1):
20880  * mslice.shape[i + offset] = mslice.shape[i] # <<<<<<<<<<<<<<
20881  * mslice.strides[i + offset] = mslice.strides[i]
20882  * mslice.suboffsets[i + offset] = mslice.suboffsets[i]
20883  */
20884  (__pyx_v_mslice->shape[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->shape[__pyx_v_i]);
20885 
20886  /* "View.MemoryView":1345
20887  * for i in range(ndim - 1, -1, -1):
20888  * mslice.shape[i + offset] = mslice.shape[i]
20889  * mslice.strides[i + offset] = mslice.strides[i] # <<<<<<<<<<<<<<
20890  * mslice.suboffsets[i + offset] = mslice.suboffsets[i]
20891  *
20892  */
20893  (__pyx_v_mslice->strides[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->strides[__pyx_v_i]);
20894 
20895  /* "View.MemoryView":1346
20896  * mslice.shape[i + offset] = mslice.shape[i]
20897  * mslice.strides[i + offset] = mslice.strides[i]
20898  * mslice.suboffsets[i + offset] = mslice.suboffsets[i] # <<<<<<<<<<<<<<
20899  *
20900  * for i in range(offset):
20901  */
20902  (__pyx_v_mslice->suboffsets[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->suboffsets[__pyx_v_i]);
20903  }
20904 
20905  /* "View.MemoryView":1348
20906  * mslice.suboffsets[i + offset] = mslice.suboffsets[i]
20907  *
20908  * for i in range(offset): # <<<<<<<<<<<<<<
20909  * mslice.shape[i] = 1
20910  * mslice.strides[i] = mslice.strides[0]
20911  */
20912  __pyx_t_1 = __pyx_v_offset;
20913  __pyx_t_2 = __pyx_t_1;
20914  for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
20915  __pyx_v_i = __pyx_t_3;
20916 
20917  /* "View.MemoryView":1349
20918  *
20919  * for i in range(offset):
20920  * mslice.shape[i] = 1 # <<<<<<<<<<<<<<
20921  * mslice.strides[i] = mslice.strides[0]
20922  * mslice.suboffsets[i] = -1
20923  */
20924  (__pyx_v_mslice->shape[__pyx_v_i]) = 1;
20925 
20926  /* "View.MemoryView":1350
20927  * for i in range(offset):
20928  * mslice.shape[i] = 1
20929  * mslice.strides[i] = mslice.strides[0] # <<<<<<<<<<<<<<
20930  * mslice.suboffsets[i] = -1
20931  *
20932  */
20933  (__pyx_v_mslice->strides[__pyx_v_i]) = (__pyx_v_mslice->strides[0]);
20934 
20935  /* "View.MemoryView":1351
20936  * mslice.shape[i] = 1
20937  * mslice.strides[i] = mslice.strides[0]
20938  * mslice.suboffsets[i] = -1 # <<<<<<<<<<<<<<
20939  *
20940  *
20941  */
20942  (__pyx_v_mslice->suboffsets[__pyx_v_i]) = -1L;
20943  }
20944 
20945  /* "View.MemoryView":1337
20946  *
20947  * @cname('__pyx_memoryview_broadcast_leading')
20948  * cdef void broadcast_leading(__Pyx_memviewslice *mslice, # <<<<<<<<<<<<<<
20949  * int ndim,
20950  * int ndim_other) nogil:
20951  */
20952 
20953  /* function exit code */
20954 }
20955 
20956 /* "View.MemoryView":1359
20957  *
20958  * @cname('__pyx_memoryview_refcount_copying')
20959  * cdef void refcount_copying(__Pyx_memviewslice *dst, bint dtype_is_object, # <<<<<<<<<<<<<<
20960  * int ndim, bint inc) nogil:
20961  *
20962  */
20963 
20964 static void __pyx_memoryview_refcount_copying(__Pyx_memviewslice *__pyx_v_dst, int __pyx_v_dtype_is_object, int __pyx_v_ndim, int __pyx_v_inc) {
20965  int __pyx_t_1;
20966 
20967  /* "View.MemoryView":1363
20968  *
20969  *
20970  * if dtype_is_object: # <<<<<<<<<<<<<<
20971  * refcount_objects_in_slice_with_gil(dst.data, dst.shape,
20972  * dst.strides, ndim, inc)
20973  */
20974  __pyx_t_1 = (__pyx_v_dtype_is_object != 0);
20975  if (__pyx_t_1) {
20976 
20977  /* "View.MemoryView":1364
20978  *
20979  * if dtype_is_object:
20980  * refcount_objects_in_slice_with_gil(dst.data, dst.shape, # <<<<<<<<<<<<<<
20981  * dst.strides, ndim, inc)
20982  *
20983  */
20984  __pyx_memoryview_refcount_objects_in_slice_with_gil(__pyx_v_dst->data, __pyx_v_dst->shape, __pyx_v_dst->strides, __pyx_v_ndim, __pyx_v_inc);
20985 
20986  /* "View.MemoryView":1363
20987  *
20988  *
20989  * if dtype_is_object: # <<<<<<<<<<<<<<
20990  * refcount_objects_in_slice_with_gil(dst.data, dst.shape,
20991  * dst.strides, ndim, inc)
20992  */
20993  }
20994 
20995  /* "View.MemoryView":1359
20996  *
20997  * @cname('__pyx_memoryview_refcount_copying')
20998  * cdef void refcount_copying(__Pyx_memviewslice *dst, bint dtype_is_object, # <<<<<<<<<<<<<<
20999  * int ndim, bint inc) nogil:
21000  *
21001  */
21002 
21003  /* function exit code */
21004 }
21005 
21006 /* "View.MemoryView":1368
21007  *
21008  * @cname('__pyx_memoryview_refcount_objects_in_slice_with_gil')
21009  * cdef void refcount_objects_in_slice_with_gil(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
21010  * Py_ssize_t *strides, int ndim,
21011  * bint inc) with gil:
21012  */
21013 
21014 static void __pyx_memoryview_refcount_objects_in_slice_with_gil(char *__pyx_v_data, Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides, int __pyx_v_ndim, int __pyx_v_inc) {
21015  __Pyx_RefNannyDeclarations
21016  #ifdef WITH_THREAD
21017  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
21018  #endif
21019  __Pyx_RefNannySetupContext("refcount_objects_in_slice_with_gil", 0);
21020 
21021  /* "View.MemoryView":1371
21022  * Py_ssize_t *strides, int ndim,
21023  * bint inc) with gil:
21024  * refcount_objects_in_slice(data, shape, strides, ndim, inc) # <<<<<<<<<<<<<<
21025  *
21026  * @cname('__pyx_memoryview_refcount_objects_in_slice')
21027  */
21028  __pyx_memoryview_refcount_objects_in_slice(__pyx_v_data, __pyx_v_shape, __pyx_v_strides, __pyx_v_ndim, __pyx_v_inc);
21029 
21030  /* "View.MemoryView":1368
21031  *
21032  * @cname('__pyx_memoryview_refcount_objects_in_slice_with_gil')
21033  * cdef void refcount_objects_in_slice_with_gil(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
21034  * Py_ssize_t *strides, int ndim,
21035  * bint inc) with gil:
21036  */
21037 
21038  /* function exit code */
21039  __Pyx_RefNannyFinishContext();
21040  #ifdef WITH_THREAD
21041  __Pyx_PyGILState_Release(__pyx_gilstate_save);
21042  #endif
21043 }
21044 
21045 /* "View.MemoryView":1374
21046  *
21047  * @cname('__pyx_memoryview_refcount_objects_in_slice')
21048  * cdef void refcount_objects_in_slice(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
21049  * Py_ssize_t *strides, int ndim, bint inc):
21050  * cdef Py_ssize_t i
21051  */
21052 
21053 static void __pyx_memoryview_refcount_objects_in_slice(char *__pyx_v_data, Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides, int __pyx_v_ndim, int __pyx_v_inc) {
21054  CYTHON_UNUSED Py_ssize_t __pyx_v_i;
21055  __Pyx_RefNannyDeclarations
21056  Py_ssize_t __pyx_t_1;
21057  Py_ssize_t __pyx_t_2;
21058  Py_ssize_t __pyx_t_3;
21059  int __pyx_t_4;
21060  __Pyx_RefNannySetupContext("refcount_objects_in_slice", 0);
21061 
21062  /* "View.MemoryView":1378
21063  * cdef Py_ssize_t i
21064  *
21065  * for i in range(shape[0]): # <<<<<<<<<<<<<<
21066  * if ndim == 1:
21067  * if inc:
21068  */
21069  __pyx_t_1 = (__pyx_v_shape[0]);
21070  __pyx_t_2 = __pyx_t_1;
21071  for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
21072  __pyx_v_i = __pyx_t_3;
21073 
21074  /* "View.MemoryView":1379
21075  *
21076  * for i in range(shape[0]):
21077  * if ndim == 1: # <<<<<<<<<<<<<<
21078  * if inc:
21079  * Py_INCREF((<PyObject **> data)[0])
21080  */
21081  __pyx_t_4 = ((__pyx_v_ndim == 1) != 0);
21082  if (__pyx_t_4) {
21083 
21084  /* "View.MemoryView":1380
21085  * for i in range(shape[0]):
21086  * if ndim == 1:
21087  * if inc: # <<<<<<<<<<<<<<
21088  * Py_INCREF((<PyObject **> data)[0])
21089  * else:
21090  */
21091  __pyx_t_4 = (__pyx_v_inc != 0);
21092  if (__pyx_t_4) {
21093 
21094  /* "View.MemoryView":1381
21095  * if ndim == 1:
21096  * if inc:
21097  * Py_INCREF((<PyObject **> data)[0]) # <<<<<<<<<<<<<<
21098  * else:
21099  * Py_DECREF((<PyObject **> data)[0])
21100  */
21101  Py_INCREF((((PyObject **)__pyx_v_data)[0]));
21102 
21103  /* "View.MemoryView":1380
21104  * for i in range(shape[0]):
21105  * if ndim == 1:
21106  * if inc: # <<<<<<<<<<<<<<
21107  * Py_INCREF((<PyObject **> data)[0])
21108  * else:
21109  */
21110  goto __pyx_L6;
21111  }
21112 
21113  /* "View.MemoryView":1383
21114  * Py_INCREF((<PyObject **> data)[0])
21115  * else:
21116  * Py_DECREF((<PyObject **> data)[0]) # <<<<<<<<<<<<<<
21117  * else:
21118  * refcount_objects_in_slice(data, shape + 1, strides + 1,
21119  */
21120  /*else*/ {
21121  Py_DECREF((((PyObject **)__pyx_v_data)[0]));
21122  }
21123  __pyx_L6:;
21124 
21125  /* "View.MemoryView":1379
21126  *
21127  * for i in range(shape[0]):
21128  * if ndim == 1: # <<<<<<<<<<<<<<
21129  * if inc:
21130  * Py_INCREF((<PyObject **> data)[0])
21131  */
21132  goto __pyx_L5;
21133  }
21134 
21135  /* "View.MemoryView":1385
21136  * Py_DECREF((<PyObject **> data)[0])
21137  * else:
21138  * refcount_objects_in_slice(data, shape + 1, strides + 1, # <<<<<<<<<<<<<<
21139  * ndim - 1, inc)
21140  *
21141  */
21142  /*else*/ {
21143 
21144  /* "View.MemoryView":1386
21145  * else:
21146  * refcount_objects_in_slice(data, shape + 1, strides + 1,
21147  * ndim - 1, inc) # <<<<<<<<<<<<<<
21148  *
21149  * data += strides[0]
21150  */
21151  __pyx_memoryview_refcount_objects_in_slice(__pyx_v_data, (__pyx_v_shape + 1), (__pyx_v_strides + 1), (__pyx_v_ndim - 1), __pyx_v_inc);
21152  }
21153  __pyx_L5:;
21154 
21155  /* "View.MemoryView":1388
21156  * ndim - 1, inc)
21157  *
21158  * data += strides[0] # <<<<<<<<<<<<<<
21159  *
21160  *
21161  */
21162  __pyx_v_data = (__pyx_v_data + (__pyx_v_strides[0]));
21163  }
21164 
21165  /* "View.MemoryView":1374
21166  *
21167  * @cname('__pyx_memoryview_refcount_objects_in_slice')
21168  * cdef void refcount_objects_in_slice(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
21169  * Py_ssize_t *strides, int ndim, bint inc):
21170  * cdef Py_ssize_t i
21171  */
21172 
21173  /* function exit code */
21174  __Pyx_RefNannyFinishContext();
21175 }
21176 
21177 /* "View.MemoryView":1394
21178  *
21179  * @cname('__pyx_memoryview_slice_assign_scalar')
21180  * cdef void slice_assign_scalar(__Pyx_memviewslice *dst, int ndim, # <<<<<<<<<<<<<<
21181  * size_t itemsize, void *item,
21182  * bint dtype_is_object) nogil:
21183  */
21184 
21185 static void __pyx_memoryview_slice_assign_scalar(__Pyx_memviewslice *__pyx_v_dst, int __pyx_v_ndim, size_t __pyx_v_itemsize, void *__pyx_v_item, int __pyx_v_dtype_is_object) {
21186 
21187  /* "View.MemoryView":1397
21188  * size_t itemsize, void *item,
21189  * bint dtype_is_object) nogil:
21190  * refcount_copying(dst, dtype_is_object, ndim, False) # <<<<<<<<<<<<<<
21191  * _slice_assign_scalar(dst.data, dst.shape, dst.strides, ndim,
21192  * itemsize, item)
21193  */
21194  __pyx_memoryview_refcount_copying(__pyx_v_dst, __pyx_v_dtype_is_object, __pyx_v_ndim, 0);
21195 
21196  /* "View.MemoryView":1398
21197  * bint dtype_is_object) nogil:
21198  * refcount_copying(dst, dtype_is_object, ndim, False)
21199  * _slice_assign_scalar(dst.data, dst.shape, dst.strides, ndim, # <<<<<<<<<<<<<<
21200  * itemsize, item)
21201  * refcount_copying(dst, dtype_is_object, ndim, True)
21202  */
21203  __pyx_memoryview__slice_assign_scalar(__pyx_v_dst->data, __pyx_v_dst->shape, __pyx_v_dst->strides, __pyx_v_ndim, __pyx_v_itemsize, __pyx_v_item);
21204 
21205  /* "View.MemoryView":1400
21206  * _slice_assign_scalar(dst.data, dst.shape, dst.strides, ndim,
21207  * itemsize, item)
21208  * refcount_copying(dst, dtype_is_object, ndim, True) # <<<<<<<<<<<<<<
21209  *
21210  *
21211  */
21212  __pyx_memoryview_refcount_copying(__pyx_v_dst, __pyx_v_dtype_is_object, __pyx_v_ndim, 1);
21213 
21214  /* "View.MemoryView":1394
21215  *
21216  * @cname('__pyx_memoryview_slice_assign_scalar')
21217  * cdef void slice_assign_scalar(__Pyx_memviewslice *dst, int ndim, # <<<<<<<<<<<<<<
21218  * size_t itemsize, void *item,
21219  * bint dtype_is_object) nogil:
21220  */
21221 
21222  /* function exit code */
21223 }
21224 
21225 /* "View.MemoryView":1404
21226  *
21227  * @cname('__pyx_memoryview__slice_assign_scalar')
21228  * cdef void _slice_assign_scalar(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
21229  * Py_ssize_t *strides, int ndim,
21230  * size_t itemsize, void *item) nogil:
21231  */
21232 
21233 static void __pyx_memoryview__slice_assign_scalar(char *__pyx_v_data, Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides, int __pyx_v_ndim, size_t __pyx_v_itemsize, void *__pyx_v_item) {
21234  CYTHON_UNUSED Py_ssize_t __pyx_v_i;
21235  Py_ssize_t __pyx_v_stride;
21236  Py_ssize_t __pyx_v_extent;
21237  int __pyx_t_1;
21238  Py_ssize_t __pyx_t_2;
21239  Py_ssize_t __pyx_t_3;
21240  Py_ssize_t __pyx_t_4;
21241 
21242  /* "View.MemoryView":1408
21243  * size_t itemsize, void *item) nogil:
21244  * cdef Py_ssize_t i
21245  * cdef Py_ssize_t stride = strides[0] # <<<<<<<<<<<<<<
21246  * cdef Py_ssize_t extent = shape[0]
21247  *
21248  */
21249  __pyx_v_stride = (__pyx_v_strides[0]);
21250 
21251  /* "View.MemoryView":1409
21252  * cdef Py_ssize_t i
21253  * cdef Py_ssize_t stride = strides[0]
21254  * cdef Py_ssize_t extent = shape[0] # <<<<<<<<<<<<<<
21255  *
21256  * if ndim == 1:
21257  */
21258  __pyx_v_extent = (__pyx_v_shape[0]);
21259 
21260  /* "View.MemoryView":1411
21261  * cdef Py_ssize_t extent = shape[0]
21262  *
21263  * if ndim == 1: # <<<<<<<<<<<<<<
21264  * for i in range(extent):
21265  * memcpy(data, item, itemsize)
21266  */
21267  __pyx_t_1 = ((__pyx_v_ndim == 1) != 0);
21268  if (__pyx_t_1) {
21269 
21270  /* "View.MemoryView":1412
21271  *
21272  * if ndim == 1:
21273  * for i in range(extent): # <<<<<<<<<<<<<<
21274  * memcpy(data, item, itemsize)
21275  * data += stride
21276  */
21277  __pyx_t_2 = __pyx_v_extent;
21278  __pyx_t_3 = __pyx_t_2;
21279  for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
21280  __pyx_v_i = __pyx_t_4;
21281 
21282  /* "View.MemoryView":1413
21283  * if ndim == 1:
21284  * for i in range(extent):
21285  * memcpy(data, item, itemsize) # <<<<<<<<<<<<<<
21286  * data += stride
21287  * else:
21288  */
21289  (void)(memcpy(__pyx_v_data, __pyx_v_item, __pyx_v_itemsize));
21290 
21291  /* "View.MemoryView":1414
21292  * for i in range(extent):
21293  * memcpy(data, item, itemsize)
21294  * data += stride # <<<<<<<<<<<<<<
21295  * else:
21296  * for i in range(extent):
21297  */
21298  __pyx_v_data = (__pyx_v_data + __pyx_v_stride);
21299  }
21300 
21301  /* "View.MemoryView":1411
21302  * cdef Py_ssize_t extent = shape[0]
21303  *
21304  * if ndim == 1: # <<<<<<<<<<<<<<
21305  * for i in range(extent):
21306  * memcpy(data, item, itemsize)
21307  */
21308  goto __pyx_L3;
21309  }
21310 
21311  /* "View.MemoryView":1416
21312  * data += stride
21313  * else:
21314  * for i in range(extent): # <<<<<<<<<<<<<<
21315  * _slice_assign_scalar(data, shape + 1, strides + 1,
21316  * ndim - 1, itemsize, item)
21317  */
21318  /*else*/ {
21319  __pyx_t_2 = __pyx_v_extent;
21320  __pyx_t_3 = __pyx_t_2;
21321  for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
21322  __pyx_v_i = __pyx_t_4;
21323 
21324  /* "View.MemoryView":1417
21325  * else:
21326  * for i in range(extent):
21327  * _slice_assign_scalar(data, shape + 1, strides + 1, # <<<<<<<<<<<<<<
21328  * ndim - 1, itemsize, item)
21329  * data += stride
21330  */
21331  __pyx_memoryview__slice_assign_scalar(__pyx_v_data, (__pyx_v_shape + 1), (__pyx_v_strides + 1), (__pyx_v_ndim - 1), __pyx_v_itemsize, __pyx_v_item);
21332 
21333  /* "View.MemoryView":1419
21334  * _slice_assign_scalar(data, shape + 1, strides + 1,
21335  * ndim - 1, itemsize, item)
21336  * data += stride # <<<<<<<<<<<<<<
21337  *
21338  *
21339  */
21340  __pyx_v_data = (__pyx_v_data + __pyx_v_stride);
21341  }
21342  }
21343  __pyx_L3:;
21344 
21345  /* "View.MemoryView":1404
21346  *
21347  * @cname('__pyx_memoryview__slice_assign_scalar')
21348  * cdef void _slice_assign_scalar(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
21349  * Py_ssize_t *strides, int ndim,
21350  * size_t itemsize, void *item) nogil:
21351  */
21352 
21353  /* function exit code */
21354 }
21355 
21356 /* "(tree fragment)":1
21357  * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<<
21358  * cdef object __pyx_PickleError
21359  * cdef object __pyx_result
21360  */
21361 
21362 /* Python wrapper */
21363 static PyObject *__pyx_pw_15View_dot_MemoryView_1__pyx_unpickle_Enum(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
21364 static PyMethodDef __pyx_mdef_15View_dot_MemoryView_1__pyx_unpickle_Enum = {"__pyx_unpickle_Enum", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_15View_dot_MemoryView_1__pyx_unpickle_Enum, METH_VARARGS|METH_KEYWORDS, 0};
21365 static PyObject *__pyx_pw_15View_dot_MemoryView_1__pyx_unpickle_Enum(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
21366  PyObject *__pyx_v___pyx_type = 0;
21367  long __pyx_v___pyx_checksum;
21368  PyObject *__pyx_v___pyx_state = 0;
21369  PyObject *__pyx_r = 0;
21370  __Pyx_RefNannyDeclarations
21371  __Pyx_RefNannySetupContext("__pyx_unpickle_Enum (wrapper)", 0);
21372  {
21373  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_type,&__pyx_n_s_pyx_checksum,&__pyx_n_s_pyx_state,0};
21374  PyObject* values[3] = {0,0,0};
21375  if (unlikely(__pyx_kwds)) {
21376  Py_ssize_t kw_args;
21377  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
21378  switch (pos_args) {
21379  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
21380  CYTHON_FALLTHROUGH;
21381  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
21382  CYTHON_FALLTHROUGH;
21383  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
21384  CYTHON_FALLTHROUGH;
21385  case 0: break;
21386  default: goto __pyx_L5_argtuple_error;
21387  }
21388  kw_args = PyDict_Size(__pyx_kwds);
21389  switch (pos_args) {
21390  case 0:
21391  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_type)) != 0)) kw_args--;
21392  else goto __pyx_L5_argtuple_error;
21393  CYTHON_FALLTHROUGH;
21394  case 1:
21395  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_checksum)) != 0)) kw_args--;
21396  else {
21397  __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_Enum", 1, 3, 3, 1); __PYX_ERR(2, 1, __pyx_L3_error)
21398  }
21399  CYTHON_FALLTHROUGH;
21400  case 2:
21401  if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_state)) != 0)) kw_args--;
21402  else {
21403  __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_Enum", 1, 3, 3, 2); __PYX_ERR(2, 1, __pyx_L3_error)
21404  }
21405  }
21406  if (unlikely(kw_args > 0)) {
21407  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__pyx_unpickle_Enum") < 0)) __PYX_ERR(2, 1, __pyx_L3_error)
21408  }
21409  } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
21410  goto __pyx_L5_argtuple_error;
21411  } else {
21412  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
21413  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
21414  values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
21415  }
21416  __pyx_v___pyx_type = values[0];
21417  __pyx_v___pyx_checksum = __Pyx_PyInt_As_long(values[1]); if (unlikely((__pyx_v___pyx_checksum == (long)-1) && PyErr_Occurred())) __PYX_ERR(2, 1, __pyx_L3_error)
21418  __pyx_v___pyx_state = values[2];
21419  }
21420  goto __pyx_L4_argument_unpacking_done;
21421  __pyx_L5_argtuple_error:;
21422  __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_Enum", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 1, __pyx_L3_error)
21423  __pyx_L3_error:;
21424  __Pyx_AddTraceback("View.MemoryView.__pyx_unpickle_Enum", __pyx_clineno, __pyx_lineno, __pyx_filename);
21425  __Pyx_RefNannyFinishContext();
21426  return NULL;
21427  __pyx_L4_argument_unpacking_done:;
21428  __pyx_r = __pyx_pf_15View_dot_MemoryView___pyx_unpickle_Enum(__pyx_self, __pyx_v___pyx_type, __pyx_v___pyx_checksum, __pyx_v___pyx_state);
21429 
21430  /* function exit code */
21431  __Pyx_RefNannyFinishContext();
21432  return __pyx_r;
21433 }
21434 
21435 static PyObject *__pyx_pf_15View_dot_MemoryView___pyx_unpickle_Enum(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state) {
21436  PyObject *__pyx_v___pyx_PickleError = 0;
21437  PyObject *__pyx_v___pyx_result = 0;
21438  PyObject *__pyx_r = NULL;
21439  __Pyx_RefNannyDeclarations
21440  int __pyx_t_1;
21441  PyObject *__pyx_t_2 = NULL;
21442  PyObject *__pyx_t_3 = NULL;
21443  PyObject *__pyx_t_4 = NULL;
21444  PyObject *__pyx_t_5 = NULL;
21445  int __pyx_t_6;
21446  __Pyx_RefNannySetupContext("__pyx_unpickle_Enum", 0);
21447 
21448  /* "(tree fragment)":4
21449  * cdef object __pyx_PickleError
21450  * cdef object __pyx_result
21451  * if __pyx_checksum != 0xb068931: # <<<<<<<<<<<<<<
21452  * from pickle import PickleError as __pyx_PickleError
21453  * raise __pyx_PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum)
21454  */
21455  __pyx_t_1 = ((__pyx_v___pyx_checksum != 0xb068931) != 0);
21456  if (__pyx_t_1) {
21457 
21458  /* "(tree fragment)":5
21459  * cdef object __pyx_result
21460  * if __pyx_checksum != 0xb068931:
21461  * from pickle import PickleError as __pyx_PickleError # <<<<<<<<<<<<<<
21462  * raise __pyx_PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum)
21463  * __pyx_result = Enum.__new__(__pyx_type)
21464  */
21465  __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 5, __pyx_L1_error)
21466  __Pyx_GOTREF(__pyx_t_2);
21467  __Pyx_INCREF(__pyx_n_s_PickleError);
21468  __Pyx_GIVEREF(__pyx_n_s_PickleError);
21469  PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_PickleError);
21470  __pyx_t_3 = __Pyx_Import(__pyx_n_s_pickle, __pyx_t_2, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 5, __pyx_L1_error)
21471  __Pyx_GOTREF(__pyx_t_3);
21472  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
21473  __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_PickleError); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 5, __pyx_L1_error)
21474  __Pyx_GOTREF(__pyx_t_2);
21475  __Pyx_INCREF(__pyx_t_2);
21476  __pyx_v___pyx_PickleError = __pyx_t_2;
21477  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
21478  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
21479 
21480  /* "(tree fragment)":6
21481  * if __pyx_checksum != 0xb068931:
21482  * from pickle import PickleError as __pyx_PickleError
21483  * raise __pyx_PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum) # <<<<<<<<<<<<<<
21484  * __pyx_result = Enum.__new__(__pyx_type)
21485  * if __pyx_state is not None:
21486  */
21487  __pyx_t_2 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 6, __pyx_L1_error)
21488  __Pyx_GOTREF(__pyx_t_2);
21489  __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Incompatible_checksums_s_vs_0xb0, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 6, __pyx_L1_error)
21490  __Pyx_GOTREF(__pyx_t_4);
21491  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
21492  __Pyx_INCREF(__pyx_v___pyx_PickleError);
21493  __pyx_t_2 = __pyx_v___pyx_PickleError; __pyx_t_5 = NULL;
21494  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
21495  __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
21496  if (likely(__pyx_t_5)) {
21497  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
21498  __Pyx_INCREF(__pyx_t_5);
21499  __Pyx_INCREF(function);
21500  __Pyx_DECREF_SET(__pyx_t_2, function);
21501  }
21502  }
21503  __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_5, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4);
21504  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
21505  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
21506  if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 6, __pyx_L1_error)
21507  __Pyx_GOTREF(__pyx_t_3);
21508  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
21509  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
21510  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
21511  __PYX_ERR(2, 6, __pyx_L1_error)
21512 
21513  /* "(tree fragment)":4
21514  * cdef object __pyx_PickleError
21515  * cdef object __pyx_result
21516  * if __pyx_checksum != 0xb068931: # <<<<<<<<<<<<<<
21517  * from pickle import PickleError as __pyx_PickleError
21518  * raise __pyx_PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum)
21519  */
21520  }
21521 
21522  /* "(tree fragment)":7
21523  * from pickle import PickleError as __pyx_PickleError
21524  * raise __pyx_PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum)
21525  * __pyx_result = Enum.__new__(__pyx_type) # <<<<<<<<<<<<<<
21526  * if __pyx_state is not None:
21527  * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
21528  */
21529  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_MemviewEnum_type), __pyx_n_s_new); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 7, __pyx_L1_error)
21530  __Pyx_GOTREF(__pyx_t_2);
21531  __pyx_t_4 = NULL;
21532  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
21533  __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
21534  if (likely(__pyx_t_4)) {
21535  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
21536  __Pyx_INCREF(__pyx_t_4);
21537  __Pyx_INCREF(function);
21538  __Pyx_DECREF_SET(__pyx_t_2, function);
21539  }
21540  }
21541  __pyx_t_3 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_v___pyx_type) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v___pyx_type);
21542  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
21543  if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 7, __pyx_L1_error)
21544  __Pyx_GOTREF(__pyx_t_3);
21545  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
21546  __pyx_v___pyx_result = __pyx_t_3;
21547  __pyx_t_3 = 0;
21548 
21549  /* "(tree fragment)":8
21550  * raise __pyx_PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum)
21551  * __pyx_result = Enum.__new__(__pyx_type)
21552  * if __pyx_state is not None: # <<<<<<<<<<<<<<
21553  * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
21554  * return __pyx_result
21555  */
21556  __pyx_t_1 = (__pyx_v___pyx_state != Py_None);
21557  __pyx_t_6 = (__pyx_t_1 != 0);
21558  if (__pyx_t_6) {
21559 
21560  /* "(tree fragment)":9
21561  * __pyx_result = Enum.__new__(__pyx_type)
21562  * if __pyx_state is not None:
21563  * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state) # <<<<<<<<<<<<<<
21564  * return __pyx_result
21565  * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state):
21566  */
21567  if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(2, 9, __pyx_L1_error)
21568  __pyx_t_3 = __pyx_unpickle_Enum__set_state(((struct __pyx_MemviewEnum_obj *)__pyx_v___pyx_result), ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 9, __pyx_L1_error)
21569  __Pyx_GOTREF(__pyx_t_3);
21570  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
21571 
21572  /* "(tree fragment)":8
21573  * raise __pyx_PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum)
21574  * __pyx_result = Enum.__new__(__pyx_type)
21575  * if __pyx_state is not None: # <<<<<<<<<<<<<<
21576  * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
21577  * return __pyx_result
21578  */
21579  }
21580 
21581  /* "(tree fragment)":10
21582  * if __pyx_state is not None:
21583  * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
21584  * return __pyx_result # <<<<<<<<<<<<<<
21585  * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state):
21586  * __pyx_result.name = __pyx_state[0]
21587  */
21588  __Pyx_XDECREF(__pyx_r);
21589  __Pyx_INCREF(__pyx_v___pyx_result);
21590  __pyx_r = __pyx_v___pyx_result;
21591  goto __pyx_L0;
21592 
21593  /* "(tree fragment)":1
21594  * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<<
21595  * cdef object __pyx_PickleError
21596  * cdef object __pyx_result
21597  */
21598 
21599  /* function exit code */
21600  __pyx_L1_error:;
21601  __Pyx_XDECREF(__pyx_t_2);
21602  __Pyx_XDECREF(__pyx_t_3);
21603  __Pyx_XDECREF(__pyx_t_4);
21604  __Pyx_XDECREF(__pyx_t_5);
21605  __Pyx_AddTraceback("View.MemoryView.__pyx_unpickle_Enum", __pyx_clineno, __pyx_lineno, __pyx_filename);
21606  __pyx_r = NULL;
21607  __pyx_L0:;
21608  __Pyx_XDECREF(__pyx_v___pyx_PickleError);
21609  __Pyx_XDECREF(__pyx_v___pyx_result);
21610  __Pyx_XGIVEREF(__pyx_r);
21611  __Pyx_RefNannyFinishContext();
21612  return __pyx_r;
21613 }
21614 
21615 /* "(tree fragment)":11
21616  * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
21617  * return __pyx_result
21618  * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state): # <<<<<<<<<<<<<<
21619  * __pyx_result.name = __pyx_state[0]
21620  * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):
21621  */
21622 
21623 static PyObject *__pyx_unpickle_Enum__set_state(struct __pyx_MemviewEnum_obj *__pyx_v___pyx_result, PyObject *__pyx_v___pyx_state) {
21624  PyObject *__pyx_r = NULL;
21625  __Pyx_RefNannyDeclarations
21626  PyObject *__pyx_t_1 = NULL;
21627  int __pyx_t_2;
21628  Py_ssize_t __pyx_t_3;
21629  int __pyx_t_4;
21630  int __pyx_t_5;
21631  PyObject *__pyx_t_6 = NULL;
21632  PyObject *__pyx_t_7 = NULL;
21633  PyObject *__pyx_t_8 = NULL;
21634  __Pyx_RefNannySetupContext("__pyx_unpickle_Enum__set_state", 0);
21635 
21636  /* "(tree fragment)":12
21637  * return __pyx_result
21638  * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state):
21639  * __pyx_result.name = __pyx_state[0] # <<<<<<<<<<<<<<
21640  * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):
21641  * __pyx_result.__dict__.update(__pyx_state[1])
21642  */
21643  if (unlikely(__pyx_v___pyx_state == Py_None)) {
21644  PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
21645  __PYX_ERR(2, 12, __pyx_L1_error)
21646  }
21647  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error)
21648  __Pyx_GOTREF(__pyx_t_1);
21649  __Pyx_GIVEREF(__pyx_t_1);
21650  __Pyx_GOTREF(__pyx_v___pyx_result->name);
21651  __Pyx_DECREF(__pyx_v___pyx_result->name);
21652  __pyx_v___pyx_result->name = __pyx_t_1;
21653  __pyx_t_1 = 0;
21654 
21655  /* "(tree fragment)":13
21656  * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state):
21657  * __pyx_result.name = __pyx_state[0]
21658  * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'): # <<<<<<<<<<<<<<
21659  * __pyx_result.__dict__.update(__pyx_state[1])
21660  */
21661  if (unlikely(__pyx_v___pyx_state == Py_None)) {
21662  PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
21663  __PYX_ERR(2, 13, __pyx_L1_error)
21664  }
21665  __pyx_t_3 = PyTuple_GET_SIZE(__pyx_v___pyx_state); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(2, 13, __pyx_L1_error)
21666  __pyx_t_4 = ((__pyx_t_3 > 1) != 0);
21667  if (__pyx_t_4) {
21668  } else {
21669  __pyx_t_2 = __pyx_t_4;
21670  goto __pyx_L4_bool_binop_done;
21671  }
21672  __pyx_t_4 = __Pyx_HasAttr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(2, 13, __pyx_L1_error)
21673  __pyx_t_5 = (__pyx_t_4 != 0);
21674  __pyx_t_2 = __pyx_t_5;
21675  __pyx_L4_bool_binop_done:;
21676  if (__pyx_t_2) {
21677 
21678  /* "(tree fragment)":14
21679  * __pyx_result.name = __pyx_state[0]
21680  * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):
21681  * __pyx_result.__dict__.update(__pyx_state[1]) # <<<<<<<<<<<<<<
21682  */
21683  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 14, __pyx_L1_error)
21684  __Pyx_GOTREF(__pyx_t_6);
21685  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_update); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 14, __pyx_L1_error)
21686  __Pyx_GOTREF(__pyx_t_7);
21687  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
21688  if (unlikely(__pyx_v___pyx_state == Py_None)) {
21689  PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
21690  __PYX_ERR(2, 14, __pyx_L1_error)
21691  }
21692  __pyx_t_6 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 14, __pyx_L1_error)
21693  __Pyx_GOTREF(__pyx_t_6);
21694  __pyx_t_8 = NULL;
21695  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) {
21696  __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7);
21697  if (likely(__pyx_t_8)) {
21698  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
21699  __Pyx_INCREF(__pyx_t_8);
21700  __Pyx_INCREF(function);
21701  __Pyx_DECREF_SET(__pyx_t_7, function);
21702  }
21703  }
21704  __pyx_t_1 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_8, __pyx_t_6) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_6);
21705  __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
21706  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
21707  if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 14, __pyx_L1_error)
21708  __Pyx_GOTREF(__pyx_t_1);
21709  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
21710  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
21711 
21712  /* "(tree fragment)":13
21713  * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state):
21714  * __pyx_result.name = __pyx_state[0]
21715  * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'): # <<<<<<<<<<<<<<
21716  * __pyx_result.__dict__.update(__pyx_state[1])
21717  */
21718  }
21719 
21720  /* "(tree fragment)":11
21721  * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
21722  * return __pyx_result
21723  * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state): # <<<<<<<<<<<<<<
21724  * __pyx_result.name = __pyx_state[0]
21725  * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):
21726  */
21727 
21728  /* function exit code */
21729  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
21730  goto __pyx_L0;
21731  __pyx_L1_error:;
21732  __Pyx_XDECREF(__pyx_t_1);
21733  __Pyx_XDECREF(__pyx_t_6);
21734  __Pyx_XDECREF(__pyx_t_7);
21735  __Pyx_XDECREF(__pyx_t_8);
21736  __Pyx_AddTraceback("View.MemoryView.__pyx_unpickle_Enum__set_state", __pyx_clineno, __pyx_lineno, __pyx_filename);
21737  __pyx_r = 0;
21738  __pyx_L0:;
21739  __Pyx_XGIVEREF(__pyx_r);
21740  __Pyx_RefNannyFinishContext();
21741  return __pyx_r;
21742 }
21743 
21744 /* "BufferFormatFromTypeInfo":1460
21745  *
21746  * @cname('__pyx_format_from_typeinfo')
21747  * cdef bytes format_from_typeinfo(__Pyx_TypeInfo *type): # <<<<<<<<<<<<<<
21748  * cdef __Pyx_StructField *field
21749  * cdef __pyx_typeinfo_string fmt
21750  */
21751 
21752 static PyObject *__pyx_format_from_typeinfo(__Pyx_TypeInfo *__pyx_v_type) {
21753  __Pyx_StructField *__pyx_v_field;
21754  struct __pyx_typeinfo_string __pyx_v_fmt;
21755  PyObject *__pyx_v_part = 0;
21756  PyObject *__pyx_v_result = 0;
21757  PyObject *__pyx_v_alignment = NULL;
21758  PyObject *__pyx_v_parts = NULL;
21759  PyObject *__pyx_v_extents = NULL;
21760  int __pyx_v_i;
21761  PyObject *__pyx_r = NULL;
21762  __Pyx_RefNannyDeclarations
21763  int __pyx_t_1;
21764  int __pyx_t_2;
21765  PyObject *__pyx_t_3 = NULL;
21766  __Pyx_StructField *__pyx_t_4;
21767  PyObject *__pyx_t_5 = NULL;
21768  PyObject *__pyx_t_6 = NULL;
21769  int __pyx_t_7;
21770  int __pyx_t_8;
21771  int __pyx_t_9;
21772  int __pyx_t_10;
21773  __Pyx_RefNannySetupContext("format_from_typeinfo", 0);
21774 
21775  /* "BufferFormatFromTypeInfo":1465
21776  * cdef bytes part, result
21777  *
21778  * if type.typegroup == 'S': # <<<<<<<<<<<<<<
21779  * assert type.fields != NULL and type.fields.type != NULL
21780  *
21781  */
21782  __pyx_t_1 = ((__pyx_v_type->typegroup == 'S') != 0);
21783  if (__pyx_t_1) {
21784 
21785  /* "BufferFormatFromTypeInfo":1466
21786  *
21787  * if type.typegroup == 'S':
21788  * assert type.fields != NULL and type.fields.type != NULL # <<<<<<<<<<<<<<
21789  *
21790  * if type.flags & __PYX_BUF_FLAGS_PACKED_STRUCT:
21791  */
21792  #ifndef CYTHON_WITHOUT_ASSERTIONS
21793  if (unlikely(!Py_OptimizeFlag)) {
21794  __pyx_t_2 = ((__pyx_v_type->fields != NULL) != 0);
21795  if (__pyx_t_2) {
21796  } else {
21797  __pyx_t_1 = __pyx_t_2;
21798  goto __pyx_L4_bool_binop_done;
21799  }
21800  __pyx_t_2 = ((__pyx_v_type->fields->type != NULL) != 0);
21801  __pyx_t_1 = __pyx_t_2;
21802  __pyx_L4_bool_binop_done:;
21803  if (unlikely(!__pyx_t_1)) {
21804  PyErr_SetNone(PyExc_AssertionError);
21805  __PYX_ERR(2, 1466, __pyx_L1_error)
21806  }
21807  }
21808  #endif
21809 
21810  /* "BufferFormatFromTypeInfo":1468
21811  * assert type.fields != NULL and type.fields.type != NULL
21812  *
21813  * if type.flags & __PYX_BUF_FLAGS_PACKED_STRUCT: # <<<<<<<<<<<<<<
21814  * alignment = b'^'
21815  * else:
21816  */
21817  __pyx_t_1 = ((__pyx_v_type->flags & __PYX_BUF_FLAGS_PACKED_STRUCT) != 0);
21818  if (__pyx_t_1) {
21819 
21820  /* "BufferFormatFromTypeInfo":1469
21821  *
21822  * if type.flags & __PYX_BUF_FLAGS_PACKED_STRUCT:
21823  * alignment = b'^' # <<<<<<<<<<<<<<
21824  * else:
21825  * alignment = b''
21826  */
21827  __Pyx_INCREF(__pyx_kp_b__26);
21828  __pyx_v_alignment = __pyx_kp_b__26;
21829 
21830  /* "BufferFormatFromTypeInfo":1468
21831  * assert type.fields != NULL and type.fields.type != NULL
21832  *
21833  * if type.flags & __PYX_BUF_FLAGS_PACKED_STRUCT: # <<<<<<<<<<<<<<
21834  * alignment = b'^'
21835  * else:
21836  */
21837  goto __pyx_L6;
21838  }
21839 
21840  /* "BufferFormatFromTypeInfo":1471
21841  * alignment = b'^'
21842  * else:
21843  * alignment = b'' # <<<<<<<<<<<<<<
21844  *
21845  * parts = [b"T{"]
21846  */
21847  /*else*/ {
21848  __Pyx_INCREF(__pyx_kp_b__27);
21849  __pyx_v_alignment = __pyx_kp_b__27;
21850  }
21851  __pyx_L6:;
21852 
21853  /* "BufferFormatFromTypeInfo":1473
21854  * alignment = b''
21855  *
21856  * parts = [b"T{"] # <<<<<<<<<<<<<<
21857  * field = type.fields
21858  *
21859  */
21860  __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 1473, __pyx_L1_error)
21861  __Pyx_GOTREF(__pyx_t_3);
21862  __Pyx_INCREF(__pyx_kp_b_T);
21863  __Pyx_GIVEREF(__pyx_kp_b_T);
21864  PyList_SET_ITEM(__pyx_t_3, 0, __pyx_kp_b_T);
21865  __pyx_v_parts = ((PyObject*)__pyx_t_3);
21866  __pyx_t_3 = 0;
21867 
21868  /* "BufferFormatFromTypeInfo":1474
21869  *
21870  * parts = [b"T{"]
21871  * field = type.fields # <<<<<<<<<<<<<<
21872  *
21873  * while field.type:
21874  */
21875  __pyx_t_4 = __pyx_v_type->fields;
21876  __pyx_v_field = __pyx_t_4;
21877 
21878  /* "BufferFormatFromTypeInfo":1476
21879  * field = type.fields
21880  *
21881  * while field.type: # <<<<<<<<<<<<<<
21882  * part = format_from_typeinfo(field.type)
21883  * parts.append(part + b':' + field.name + b':')
21884  */
21885  while (1) {
21886  __pyx_t_1 = (__pyx_v_field->type != 0);
21887  if (!__pyx_t_1) break;
21888 
21889  /* "BufferFormatFromTypeInfo":1477
21890  *
21891  * while field.type:
21892  * part = format_from_typeinfo(field.type) # <<<<<<<<<<<<<<
21893  * parts.append(part + b':' + field.name + b':')
21894  * field += 1
21895  */
21896  __pyx_t_3 = __pyx_format_from_typeinfo(__pyx_v_field->type); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 1477, __pyx_L1_error)
21897  __Pyx_GOTREF(__pyx_t_3);
21898  __Pyx_XDECREF_SET(__pyx_v_part, ((PyObject*)__pyx_t_3));
21899  __pyx_t_3 = 0;
21900 
21901  /* "BufferFormatFromTypeInfo":1478
21902  * while field.type:
21903  * part = format_from_typeinfo(field.type)
21904  * parts.append(part + b':' + field.name + b':') # <<<<<<<<<<<<<<
21905  * field += 1
21906  *
21907  */
21908  __pyx_t_3 = PyNumber_Add(__pyx_v_part, __pyx_kp_b__28); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 1478, __pyx_L1_error)
21909  __Pyx_GOTREF(__pyx_t_3);
21910  __pyx_t_5 = __Pyx_PyBytes_FromString(__pyx_v_field->name); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 1478, __pyx_L1_error)
21911  __Pyx_GOTREF(__pyx_t_5);
21912  __pyx_t_6 = PyNumber_Add(__pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 1478, __pyx_L1_error)
21913  __Pyx_GOTREF(__pyx_t_6);
21914  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
21915  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
21916  __pyx_t_5 = PyNumber_Add(__pyx_t_6, __pyx_kp_b__28); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 1478, __pyx_L1_error)
21917  __Pyx_GOTREF(__pyx_t_5);
21918  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
21919  __pyx_t_7 = __Pyx_PyList_Append(__pyx_v_parts, __pyx_t_5); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(2, 1478, __pyx_L1_error)
21920  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
21921 
21922  /* "BufferFormatFromTypeInfo":1479
21923  * part = format_from_typeinfo(field.type)
21924  * parts.append(part + b':' + field.name + b':')
21925  * field += 1 # <<<<<<<<<<<<<<
21926  *
21927  * result = alignment.join(parts) + b'}'
21928  */
21929  __pyx_v_field = (__pyx_v_field + 1);
21930  }
21931 
21932  /* "BufferFormatFromTypeInfo":1481
21933  * field += 1
21934  *
21935  * result = alignment.join(parts) + b'}' # <<<<<<<<<<<<<<
21936  * else:
21937  * fmt = __Pyx_TypeInfoToFormat(type)
21938  */
21939  __pyx_t_5 = __Pyx_PyBytes_Join(__pyx_v_alignment, __pyx_v_parts); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 1481, __pyx_L1_error)
21940  __Pyx_GOTREF(__pyx_t_5);
21941  __pyx_t_6 = PyNumber_Add(__pyx_t_5, __pyx_kp_b__29); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 1481, __pyx_L1_error)
21942  __Pyx_GOTREF(__pyx_t_6);
21943  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
21944  if (!(likely(PyBytes_CheckExact(__pyx_t_6))||((__pyx_t_6) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_6)->tp_name), 0))) __PYX_ERR(2, 1481, __pyx_L1_error)
21945  __pyx_v_result = ((PyObject*)__pyx_t_6);
21946  __pyx_t_6 = 0;
21947 
21948  /* "BufferFormatFromTypeInfo":1465
21949  * cdef bytes part, result
21950  *
21951  * if type.typegroup == 'S': # <<<<<<<<<<<<<<
21952  * assert type.fields != NULL and type.fields.type != NULL
21953  *
21954  */
21955  goto __pyx_L3;
21956  }
21957 
21958  /* "BufferFormatFromTypeInfo":1483
21959  * result = alignment.join(parts) + b'}'
21960  * else:
21961  * fmt = __Pyx_TypeInfoToFormat(type) # <<<<<<<<<<<<<<
21962  * if type.arraysize[0]:
21963  * extents = [unicode(type.arraysize[i]) for i in range(type.ndim)]
21964  */
21965  /*else*/ {
21966  __pyx_v_fmt = __Pyx_TypeInfoToFormat(__pyx_v_type);
21967 
21968  /* "BufferFormatFromTypeInfo":1484
21969  * else:
21970  * fmt = __Pyx_TypeInfoToFormat(type)
21971  * if type.arraysize[0]: # <<<<<<<<<<<<<<
21972  * extents = [unicode(type.arraysize[i]) for i in range(type.ndim)]
21973  * result = (u"(%s)" % u','.join(extents)).encode('ascii') + fmt.string
21974  */
21975  __pyx_t_1 = ((__pyx_v_type->arraysize[0]) != 0);
21976  if (__pyx_t_1) {
21977 
21978  /* "BufferFormatFromTypeInfo":1485
21979  * fmt = __Pyx_TypeInfoToFormat(type)
21980  * if type.arraysize[0]:
21981  * extents = [unicode(type.arraysize[i]) for i in range(type.ndim)] # <<<<<<<<<<<<<<
21982  * result = (u"(%s)" % u','.join(extents)).encode('ascii') + fmt.string
21983  * else:
21984  */
21985  __pyx_t_6 = PyList_New(0); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 1485, __pyx_L1_error)
21986  __Pyx_GOTREF(__pyx_t_6);
21987  __pyx_t_8 = __pyx_v_type->ndim;
21988  __pyx_t_9 = __pyx_t_8;
21989  for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) {
21990  __pyx_v_i = __pyx_t_10;
21991  __pyx_t_5 = __Pyx_PyInt_FromSize_t((__pyx_v_type->arraysize[__pyx_v_i])); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 1485, __pyx_L1_error)
21992  __Pyx_GOTREF(__pyx_t_5);
21993  __pyx_t_3 = __Pyx_PyObject_Unicode(__pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 1485, __pyx_L1_error)
21994  __Pyx_GOTREF(__pyx_t_3);
21995  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
21996  if (unlikely(__Pyx_ListComp_Append(__pyx_t_6, (PyObject*)__pyx_t_3))) __PYX_ERR(2, 1485, __pyx_L1_error)
21997  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
21998  }
21999  __pyx_v_extents = ((PyObject*)__pyx_t_6);
22000  __pyx_t_6 = 0;
22001 
22002  /* "BufferFormatFromTypeInfo":1486
22003  * if type.arraysize[0]:
22004  * extents = [unicode(type.arraysize[i]) for i in range(type.ndim)]
22005  * result = (u"(%s)" % u','.join(extents)).encode('ascii') + fmt.string # <<<<<<<<<<<<<<
22006  * else:
22007  * result = fmt.string
22008  */
22009  __pyx_t_6 = PyUnicode_Join(__pyx_kp_u__30, __pyx_v_extents); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 1486, __pyx_L1_error)
22010  __Pyx_GOTREF(__pyx_t_6);
22011  __pyx_t_3 = PyUnicode_Format(__pyx_kp_u_s, __pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 1486, __pyx_L1_error)
22012  __Pyx_GOTREF(__pyx_t_3);
22013  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
22014  __pyx_t_6 = PyUnicode_AsASCIIString(((PyObject*)__pyx_t_3)); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 1486, __pyx_L1_error)
22015  __Pyx_GOTREF(__pyx_t_6);
22016  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
22017  __pyx_t_3 = __Pyx_PyObject_FromString(__pyx_v_fmt.string); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 1486, __pyx_L1_error)
22018  __Pyx_GOTREF(__pyx_t_3);
22019  __pyx_t_5 = PyNumber_Add(__pyx_t_6, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 1486, __pyx_L1_error)
22020  __Pyx_GOTREF(__pyx_t_5);
22021  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
22022  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
22023  if (!(likely(PyBytes_CheckExact(__pyx_t_5))||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_5)->tp_name), 0))) __PYX_ERR(2, 1486, __pyx_L1_error)
22024  __pyx_v_result = ((PyObject*)__pyx_t_5);
22025  __pyx_t_5 = 0;
22026 
22027  /* "BufferFormatFromTypeInfo":1484
22028  * else:
22029  * fmt = __Pyx_TypeInfoToFormat(type)
22030  * if type.arraysize[0]: # <<<<<<<<<<<<<<
22031  * extents = [unicode(type.arraysize[i]) for i in range(type.ndim)]
22032  * result = (u"(%s)" % u','.join(extents)).encode('ascii') + fmt.string
22033  */
22034  goto __pyx_L9;
22035  }
22036 
22037  /* "BufferFormatFromTypeInfo":1488
22038  * result = (u"(%s)" % u','.join(extents)).encode('ascii') + fmt.string
22039  * else:
22040  * result = fmt.string # <<<<<<<<<<<<<<
22041  *
22042  * return result
22043  */
22044  /*else*/ {
22045  __pyx_t_5 = __Pyx_PyObject_FromString(__pyx_v_fmt.string); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 1488, __pyx_L1_error)
22046  __Pyx_GOTREF(__pyx_t_5);
22047  __pyx_v_result = ((PyObject*)__pyx_t_5);
22048  __pyx_t_5 = 0;
22049  }
22050  __pyx_L9:;
22051  }
22052  __pyx_L3:;
22053 
22054  /* "BufferFormatFromTypeInfo":1490
22055  * result = fmt.string
22056  *
22057  * return result # <<<<<<<<<<<<<<
22058  */
22059  __Pyx_XDECREF(__pyx_r);
22060  __Pyx_INCREF(__pyx_v_result);
22061  __pyx_r = __pyx_v_result;
22062  goto __pyx_L0;
22063 
22064  /* "BufferFormatFromTypeInfo":1460
22065  *
22066  * @cname('__pyx_format_from_typeinfo')
22067  * cdef bytes format_from_typeinfo(__Pyx_TypeInfo *type): # <<<<<<<<<<<<<<
22068  * cdef __Pyx_StructField *field
22069  * cdef __pyx_typeinfo_string fmt
22070  */
22071 
22072  /* function exit code */
22073  __pyx_L1_error:;
22074  __Pyx_XDECREF(__pyx_t_3);
22075  __Pyx_XDECREF(__pyx_t_5);
22076  __Pyx_XDECREF(__pyx_t_6);
22077  __Pyx_AddTraceback("BufferFormatFromTypeInfo.format_from_typeinfo", __pyx_clineno, __pyx_lineno, __pyx_filename);
22078  __pyx_r = 0;
22079  __pyx_L0:;
22080  __Pyx_XDECREF(__pyx_v_part);
22081  __Pyx_XDECREF(__pyx_v_result);
22082  __Pyx_XDECREF(__pyx_v_alignment);
22083  __Pyx_XDECREF(__pyx_v_parts);
22084  __Pyx_XDECREF(__pyx_v_extents);
22085  __Pyx_XGIVEREF(__pyx_r);
22086  __Pyx_RefNannyFinishContext();
22087  return __pyx_r;
22088 }
22089 static struct __pyx_vtabstruct_array __pyx_vtable_array;
22090 
22091 static PyObject *__pyx_tp_new_array(PyTypeObject *t, PyObject *a, PyObject *k) {
22092  struct __pyx_array_obj *p;
22093  PyObject *o;
22094  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
22095  o = (*t->tp_alloc)(t, 0);
22096  } else {
22097  o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
22098  }
22099  if (unlikely(!o)) return 0;
22100  p = ((struct __pyx_array_obj *)o);
22101  p->__pyx_vtab = __pyx_vtabptr_array;
22102  p->mode = ((PyObject*)Py_None); Py_INCREF(Py_None);
22103  p->_format = ((PyObject*)Py_None); Py_INCREF(Py_None);
22104  if (unlikely(__pyx_array___cinit__(o, a, k) < 0)) goto bad;
22105  return o;
22106  bad:
22107  Py_DECREF(o); o = 0;
22108  return NULL;
22109 }
22110 
22111 static void __pyx_tp_dealloc_array(PyObject *o) {
22112  struct __pyx_array_obj *p = (struct __pyx_array_obj *)o;
22113  #if CYTHON_USE_TP_FINALIZE
22114  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) {
22115  if (PyObject_CallFinalizerFromDealloc(o)) return;
22116  }
22117  #endif
22118  {
22119  PyObject *etype, *eval, *etb;
22120  PyErr_Fetch(&etype, &eval, &etb);
22121  ++Py_REFCNT(o);
22122  __pyx_array___dealloc__(o);
22123  --Py_REFCNT(o);
22124  PyErr_Restore(etype, eval, etb);
22125  }
22126  Py_CLEAR(p->mode);
22127  Py_CLEAR(p->_format);
22128  (*Py_TYPE(o)->tp_free)(o);
22129 }
22130 static PyObject *__pyx_sq_item_array(PyObject *o, Py_ssize_t i) {
22131  PyObject *r;
22132  PyObject *x = PyInt_FromSsize_t(i); if(!x) return 0;
22133  r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x);
22134  Py_DECREF(x);
22135  return r;
22136 }
22137 
22138 static int __pyx_mp_ass_subscript_array(PyObject *o, PyObject *i, PyObject *v) {
22139  if (v) {
22140  return __pyx_array___setitem__(o, i, v);
22141  }
22142  else {
22143  PyErr_Format(PyExc_NotImplementedError,
22144  "Subscript deletion not supported by %.200s", Py_TYPE(o)->tp_name);
22145  return -1;
22146  }
22147 }
22148 
22149 static PyObject *__pyx_tp_getattro_array(PyObject *o, PyObject *n) {
22150  PyObject *v = __Pyx_PyObject_GenericGetAttr(o, n);
22151  if (!v && PyErr_ExceptionMatches(PyExc_AttributeError)) {
22152  PyErr_Clear();
22153  v = __pyx_array___getattr__(o, n);
22154  }
22155  return v;
22156 }
22157 
22158 static PyObject *__pyx_getprop___pyx_array_memview(PyObject *o, CYTHON_UNUSED void *x) {
22159  return __pyx_pw_15View_dot_MemoryView_5array_7memview_1__get__(o);
22160 }
22161 
22162 static PyMethodDef __pyx_methods_array[] = {
22163  {"__getattr__", (PyCFunction)__pyx_array___getattr__, METH_O|METH_COEXIST, 0},
22164  {"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_array_1__reduce_cython__, METH_NOARGS, 0},
22165  {"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_array_3__setstate_cython__, METH_O, 0},
22166  {0, 0, 0, 0}
22167 };
22168 
22169 static struct PyGetSetDef __pyx_getsets_array[] = {
22170  {(char *)"memview", __pyx_getprop___pyx_array_memview, 0, (char *)0, 0},
22171  {0, 0, 0, 0, 0}
22172 };
22173 
22174 static PySequenceMethods __pyx_tp_as_sequence_array = {
22175  __pyx_array___len__, /*sq_length*/
22176  0, /*sq_concat*/
22177  0, /*sq_repeat*/
22178  __pyx_sq_item_array, /*sq_item*/
22179  0, /*sq_slice*/
22180  0, /*sq_ass_item*/
22181  0, /*sq_ass_slice*/
22182  0, /*sq_contains*/
22183  0, /*sq_inplace_concat*/
22184  0, /*sq_inplace_repeat*/
22185 };
22186 
22187 static PyMappingMethods __pyx_tp_as_mapping_array = {
22188  __pyx_array___len__, /*mp_length*/
22189  __pyx_array___getitem__, /*mp_subscript*/
22190  __pyx_mp_ass_subscript_array, /*mp_ass_subscript*/
22191 };
22192 
22193 static PyBufferProcs __pyx_tp_as_buffer_array = {
22194  #if PY_MAJOR_VERSION < 3
22195  0, /*bf_getreadbuffer*/
22196  #endif
22197  #if PY_MAJOR_VERSION < 3
22198  0, /*bf_getwritebuffer*/
22199  #endif
22200  #if PY_MAJOR_VERSION < 3
22201  0, /*bf_getsegcount*/
22202  #endif
22203  #if PY_MAJOR_VERSION < 3
22204  0, /*bf_getcharbuffer*/
22205  #endif
22206  __pyx_array_getbuffer, /*bf_getbuffer*/
22207  0, /*bf_releasebuffer*/
22208 };
22209 
22210 static PyTypeObject __pyx_type___pyx_array = {
22211  PyVarObject_HEAD_INIT(0, 0)
22212  "cpartitioning.array", /*tp_name*/
22213  sizeof(struct __pyx_array_obj), /*tp_basicsize*/
22214  0, /*tp_itemsize*/
22215  __pyx_tp_dealloc_array, /*tp_dealloc*/
22216  0, /*tp_print*/
22217  0, /*tp_getattr*/
22218  0, /*tp_setattr*/
22219  #if PY_MAJOR_VERSION < 3
22220  0, /*tp_compare*/
22221  #endif
22222  #if PY_MAJOR_VERSION >= 3
22223  0, /*tp_as_async*/
22224  #endif
22225  0, /*tp_repr*/
22226  0, /*tp_as_number*/
22227  &__pyx_tp_as_sequence_array, /*tp_as_sequence*/
22228  &__pyx_tp_as_mapping_array, /*tp_as_mapping*/
22229  0, /*tp_hash*/
22230  0, /*tp_call*/
22231  0, /*tp_str*/
22232  __pyx_tp_getattro_array, /*tp_getattro*/
22233  0, /*tp_setattro*/
22234  &__pyx_tp_as_buffer_array, /*tp_as_buffer*/
22235  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
22236  0, /*tp_doc*/
22237  0, /*tp_traverse*/
22238  0, /*tp_clear*/
22239  0, /*tp_richcompare*/
22240  0, /*tp_weaklistoffset*/
22241  0, /*tp_iter*/
22242  0, /*tp_iternext*/
22243  __pyx_methods_array, /*tp_methods*/
22244  0, /*tp_members*/
22245  __pyx_getsets_array, /*tp_getset*/
22246  0, /*tp_base*/
22247  0, /*tp_dict*/
22248  0, /*tp_descr_get*/
22249  0, /*tp_descr_set*/
22250  0, /*tp_dictoffset*/
22251  0, /*tp_init*/
22252  0, /*tp_alloc*/
22253  __pyx_tp_new_array, /*tp_new*/
22254  0, /*tp_free*/
22255  0, /*tp_is_gc*/
22256  0, /*tp_bases*/
22257  0, /*tp_mro*/
22258  0, /*tp_cache*/
22259  0, /*tp_subclasses*/
22260  0, /*tp_weaklist*/
22261  0, /*tp_del*/
22262  0, /*tp_version_tag*/
22263  #if PY_VERSION_HEX >= 0x030400a1
22264  0, /*tp_finalize*/
22265  #endif
22266 };
22267 
22268 static PyObject *__pyx_tp_new_Enum(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
22269  struct __pyx_MemviewEnum_obj *p;
22270  PyObject *o;
22271  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
22272  o = (*t->tp_alloc)(t, 0);
22273  } else {
22274  o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
22275  }
22276  if (unlikely(!o)) return 0;
22277  p = ((struct __pyx_MemviewEnum_obj *)o);
22278  p->name = Py_None; Py_INCREF(Py_None);
22279  return o;
22280 }
22281 
22282 static void __pyx_tp_dealloc_Enum(PyObject *o) {
22283  struct __pyx_MemviewEnum_obj *p = (struct __pyx_MemviewEnum_obj *)o;
22284  #if CYTHON_USE_TP_FINALIZE
22285  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
22286  if (PyObject_CallFinalizerFromDealloc(o)) return;
22287  }
22288  #endif
22289  PyObject_GC_UnTrack(o);
22290  Py_CLEAR(p->name);
22291  (*Py_TYPE(o)->tp_free)(o);
22292 }
22293 
22294 static int __pyx_tp_traverse_Enum(PyObject *o, visitproc v, void *a) {
22295  int e;
22296  struct __pyx_MemviewEnum_obj *p = (struct __pyx_MemviewEnum_obj *)o;
22297  if (p->name) {
22298  e = (*v)(p->name, a); if (e) return e;
22299  }
22300  return 0;
22301 }
22302 
22303 static int __pyx_tp_clear_Enum(PyObject *o) {
22304  PyObject* tmp;
22305  struct __pyx_MemviewEnum_obj *p = (struct __pyx_MemviewEnum_obj *)o;
22306  tmp = ((PyObject*)p->name);
22307  p->name = Py_None; Py_INCREF(Py_None);
22308  Py_XDECREF(tmp);
22309  return 0;
22310 }
22311 
22312 static PyMethodDef __pyx_methods_Enum[] = {
22313  {"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_MemviewEnum_1__reduce_cython__, METH_NOARGS, 0},
22314  {"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_MemviewEnum_3__setstate_cython__, METH_O, 0},
22315  {0, 0, 0, 0}
22316 };
22317 
22318 static PyTypeObject __pyx_type___pyx_MemviewEnum = {
22319  PyVarObject_HEAD_INIT(0, 0)
22320  "cpartitioning.Enum", /*tp_name*/
22321  sizeof(struct __pyx_MemviewEnum_obj), /*tp_basicsize*/
22322  0, /*tp_itemsize*/
22323  __pyx_tp_dealloc_Enum, /*tp_dealloc*/
22324  0, /*tp_print*/
22325  0, /*tp_getattr*/
22326  0, /*tp_setattr*/
22327  #if PY_MAJOR_VERSION < 3
22328  0, /*tp_compare*/
22329  #endif
22330  #if PY_MAJOR_VERSION >= 3
22331  0, /*tp_as_async*/
22332  #endif
22333  __pyx_MemviewEnum___repr__, /*tp_repr*/
22334  0, /*tp_as_number*/
22335  0, /*tp_as_sequence*/
22336  0, /*tp_as_mapping*/
22337  0, /*tp_hash*/
22338  0, /*tp_call*/
22339  0, /*tp_str*/
22340  0, /*tp_getattro*/
22341  0, /*tp_setattro*/
22342  0, /*tp_as_buffer*/
22343  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
22344  0, /*tp_doc*/
22345  __pyx_tp_traverse_Enum, /*tp_traverse*/
22346  __pyx_tp_clear_Enum, /*tp_clear*/
22347  0, /*tp_richcompare*/
22348  0, /*tp_weaklistoffset*/
22349  0, /*tp_iter*/
22350  0, /*tp_iternext*/
22351  __pyx_methods_Enum, /*tp_methods*/
22352  0, /*tp_members*/
22353  0, /*tp_getset*/
22354  0, /*tp_base*/
22355  0, /*tp_dict*/
22356  0, /*tp_descr_get*/
22357  0, /*tp_descr_set*/
22358  0, /*tp_dictoffset*/
22359  __pyx_MemviewEnum___init__, /*tp_init*/
22360  0, /*tp_alloc*/
22361  __pyx_tp_new_Enum, /*tp_new*/
22362  0, /*tp_free*/
22363  0, /*tp_is_gc*/
22364  0, /*tp_bases*/
22365  0, /*tp_mro*/
22366  0, /*tp_cache*/
22367  0, /*tp_subclasses*/
22368  0, /*tp_weaklist*/
22369  0, /*tp_del*/
22370  0, /*tp_version_tag*/
22371  #if PY_VERSION_HEX >= 0x030400a1
22372  0, /*tp_finalize*/
22373  #endif
22374 };
22375 static struct __pyx_vtabstruct_memoryview __pyx_vtable_memoryview;
22376 
22377 static PyObject *__pyx_tp_new_memoryview(PyTypeObject *t, PyObject *a, PyObject *k) {
22378  struct __pyx_memoryview_obj *p;
22379  PyObject *o;
22380  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
22381  o = (*t->tp_alloc)(t, 0);
22382  } else {
22383  o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
22384  }
22385  if (unlikely(!o)) return 0;
22386  p = ((struct __pyx_memoryview_obj *)o);
22387  p->__pyx_vtab = __pyx_vtabptr_memoryview;
22388  p->obj = Py_None; Py_INCREF(Py_None);
22389  p->_size = Py_None; Py_INCREF(Py_None);
22390  p->_array_interface = Py_None; Py_INCREF(Py_None);
22391  p->view.obj = NULL;
22392  if (unlikely(__pyx_memoryview___cinit__(o, a, k) < 0)) goto bad;
22393  return o;
22394  bad:
22395  Py_DECREF(o); o = 0;
22396  return NULL;
22397 }
22398 
22399 static void __pyx_tp_dealloc_memoryview(PyObject *o) {
22400  struct __pyx_memoryview_obj *p = (struct __pyx_memoryview_obj *)o;
22401  #if CYTHON_USE_TP_FINALIZE
22402  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
22403  if (PyObject_CallFinalizerFromDealloc(o)) return;
22404  }
22405  #endif
22406  PyObject_GC_UnTrack(o);
22407  {
22408  PyObject *etype, *eval, *etb;
22409  PyErr_Fetch(&etype, &eval, &etb);
22410  ++Py_REFCNT(o);
22411  __pyx_memoryview___dealloc__(o);
22412  --Py_REFCNT(o);
22413  PyErr_Restore(etype, eval, etb);
22414  }
22415  Py_CLEAR(p->obj);
22416  Py_CLEAR(p->_size);
22417  Py_CLEAR(p->_array_interface);
22418  (*Py_TYPE(o)->tp_free)(o);
22419 }
22420 
22421 static int __pyx_tp_traverse_memoryview(PyObject *o, visitproc v, void *a) {
22422  int e;
22423  struct __pyx_memoryview_obj *p = (struct __pyx_memoryview_obj *)o;
22424  if (p->obj) {
22425  e = (*v)(p->obj, a); if (e) return e;
22426  }
22427  if (p->_size) {
22428  e = (*v)(p->_size, a); if (e) return e;
22429  }
22430  if (p->_array_interface) {
22431  e = (*v)(p->_array_interface, a); if (e) return e;
22432  }
22433  if (p->view.obj) {
22434  e = (*v)(p->view.obj, a); if (e) return e;
22435  }
22436  return 0;
22437 }
22438 
22439 static int __pyx_tp_clear_memoryview(PyObject *o) {
22440  PyObject* tmp;
22441  struct __pyx_memoryview_obj *p = (struct __pyx_memoryview_obj *)o;
22442  tmp = ((PyObject*)p->obj);
22443  p->obj = Py_None; Py_INCREF(Py_None);
22444  Py_XDECREF(tmp);
22445  tmp = ((PyObject*)p->_size);
22446  p->_size = Py_None; Py_INCREF(Py_None);
22447  Py_XDECREF(tmp);
22448  tmp = ((PyObject*)p->_array_interface);
22449  p->_array_interface = Py_None; Py_INCREF(Py_None);
22450  Py_XDECREF(tmp);
22451  Py_CLEAR(p->view.obj);
22452  return 0;
22453 }
22454 static PyObject *__pyx_sq_item_memoryview(PyObject *o, Py_ssize_t i) {
22455  PyObject *r;
22456  PyObject *x = PyInt_FromSsize_t(i); if(!x) return 0;
22457  r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x);
22458  Py_DECREF(x);
22459  return r;
22460 }
22461 
22462 static int __pyx_mp_ass_subscript_memoryview(PyObject *o, PyObject *i, PyObject *v) {
22463  if (v) {
22464  return __pyx_memoryview___setitem__(o, i, v);
22465  }
22466  else {
22467  PyErr_Format(PyExc_NotImplementedError,
22468  "Subscript deletion not supported by %.200s", Py_TYPE(o)->tp_name);
22469  return -1;
22470  }
22471 }
22472 
22473 static PyObject *__pyx_getprop___pyx_memoryview_T(PyObject *o, CYTHON_UNUSED void *x) {
22474  return __pyx_pw_15View_dot_MemoryView_10memoryview_1T_1__get__(o);
22475 }
22476 
22477 static PyObject *__pyx_getprop___pyx_memoryview_base(PyObject *o, CYTHON_UNUSED void *x) {
22478  return __pyx_pw_15View_dot_MemoryView_10memoryview_4base_1__get__(o);
22479 }
22480 
22481 static PyObject *__pyx_getprop___pyx_memoryview_shape(PyObject *o, CYTHON_UNUSED void *x) {
22482  return __pyx_pw_15View_dot_MemoryView_10memoryview_5shape_1__get__(o);
22483 }
22484 
22485 static PyObject *__pyx_getprop___pyx_memoryview_strides(PyObject *o, CYTHON_UNUSED void *x) {
22486  return __pyx_pw_15View_dot_MemoryView_10memoryview_7strides_1__get__(o);
22487 }
22488 
22489 static PyObject *__pyx_getprop___pyx_memoryview_suboffsets(PyObject *o, CYTHON_UNUSED void *x) {
22490  return __pyx_pw_15View_dot_MemoryView_10memoryview_10suboffsets_1__get__(o);
22491 }
22492 
22493 static PyObject *__pyx_getprop___pyx_memoryview_ndim(PyObject *o, CYTHON_UNUSED void *x) {
22494  return __pyx_pw_15View_dot_MemoryView_10memoryview_4ndim_1__get__(o);
22495 }
22496 
22497 static PyObject *__pyx_getprop___pyx_memoryview_itemsize(PyObject *o, CYTHON_UNUSED void *x) {
22498  return __pyx_pw_15View_dot_MemoryView_10memoryview_8itemsize_1__get__(o);
22499 }
22500 
22501 static PyObject *__pyx_getprop___pyx_memoryview_nbytes(PyObject *o, CYTHON_UNUSED void *x) {
22502  return __pyx_pw_15View_dot_MemoryView_10memoryview_6nbytes_1__get__(o);
22503 }
22504 
22505 static PyObject *__pyx_getprop___pyx_memoryview_size(PyObject *o, CYTHON_UNUSED void *x) {
22506  return __pyx_pw_15View_dot_MemoryView_10memoryview_4size_1__get__(o);
22507 }
22508 
22509 static PyMethodDef __pyx_methods_memoryview[] = {
22510  {"is_c_contig", (PyCFunction)__pyx_memoryview_is_c_contig, METH_NOARGS, 0},
22511  {"is_f_contig", (PyCFunction)__pyx_memoryview_is_f_contig, METH_NOARGS, 0},
22512  {"copy", (PyCFunction)__pyx_memoryview_copy, METH_NOARGS, 0},
22513  {"copy_fortran", (PyCFunction)__pyx_memoryview_copy_fortran, METH_NOARGS, 0},
22514  {"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_memoryview_1__reduce_cython__, METH_NOARGS, 0},
22515  {"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_memoryview_3__setstate_cython__, METH_O, 0},
22516  {0, 0, 0, 0}
22517 };
22518 
22519 static struct PyGetSetDef __pyx_getsets_memoryview[] = {
22520  {(char *)"T", __pyx_getprop___pyx_memoryview_T, 0, (char *)0, 0},
22521  {(char *)"base", __pyx_getprop___pyx_memoryview_base, 0, (char *)0, 0},
22522  {(char *)"shape", __pyx_getprop___pyx_memoryview_shape, 0, (char *)0, 0},
22523  {(char *)"strides", __pyx_getprop___pyx_memoryview_strides, 0, (char *)0, 0},
22524  {(char *)"suboffsets", __pyx_getprop___pyx_memoryview_suboffsets, 0, (char *)0, 0},
22525  {(char *)"ndim", __pyx_getprop___pyx_memoryview_ndim, 0, (char *)0, 0},
22526  {(char *)"itemsize", __pyx_getprop___pyx_memoryview_itemsize, 0, (char *)0, 0},
22527  {(char *)"nbytes", __pyx_getprop___pyx_memoryview_nbytes, 0, (char *)0, 0},
22528  {(char *)"size", __pyx_getprop___pyx_memoryview_size, 0, (char *)0, 0},
22529  {0, 0, 0, 0, 0}
22530 };
22531 
22532 static PySequenceMethods __pyx_tp_as_sequence_memoryview = {
22533  __pyx_memoryview___len__, /*sq_length*/
22534  0, /*sq_concat*/
22535  0, /*sq_repeat*/
22536  __pyx_sq_item_memoryview, /*sq_item*/
22537  0, /*sq_slice*/
22538  0, /*sq_ass_item*/
22539  0, /*sq_ass_slice*/
22540  0, /*sq_contains*/
22541  0, /*sq_inplace_concat*/
22542  0, /*sq_inplace_repeat*/
22543 };
22544 
22545 static PyMappingMethods __pyx_tp_as_mapping_memoryview = {
22546  __pyx_memoryview___len__, /*mp_length*/
22547  __pyx_memoryview___getitem__, /*mp_subscript*/
22548  __pyx_mp_ass_subscript_memoryview, /*mp_ass_subscript*/
22549 };
22550 
22551 static PyBufferProcs __pyx_tp_as_buffer_memoryview = {
22552  #if PY_MAJOR_VERSION < 3
22553  0, /*bf_getreadbuffer*/
22554  #endif
22555  #if PY_MAJOR_VERSION < 3
22556  0, /*bf_getwritebuffer*/
22557  #endif
22558  #if PY_MAJOR_VERSION < 3
22559  0, /*bf_getsegcount*/
22560  #endif
22561  #if PY_MAJOR_VERSION < 3
22562  0, /*bf_getcharbuffer*/
22563  #endif
22564  __pyx_memoryview_getbuffer, /*bf_getbuffer*/
22565  0, /*bf_releasebuffer*/
22566 };
22567 
22568 static PyTypeObject __pyx_type___pyx_memoryview = {
22569  PyVarObject_HEAD_INIT(0, 0)
22570  "cpartitioning.memoryview", /*tp_name*/
22571  sizeof(struct __pyx_memoryview_obj), /*tp_basicsize*/
22572  0, /*tp_itemsize*/
22573  __pyx_tp_dealloc_memoryview, /*tp_dealloc*/
22574  0, /*tp_print*/
22575  0, /*tp_getattr*/
22576  0, /*tp_setattr*/
22577  #if PY_MAJOR_VERSION < 3
22578  0, /*tp_compare*/
22579  #endif
22580  #if PY_MAJOR_VERSION >= 3
22581  0, /*tp_as_async*/
22582  #endif
22583  __pyx_memoryview___repr__, /*tp_repr*/
22584  0, /*tp_as_number*/
22585  &__pyx_tp_as_sequence_memoryview, /*tp_as_sequence*/
22586  &__pyx_tp_as_mapping_memoryview, /*tp_as_mapping*/
22587  0, /*tp_hash*/
22588  0, /*tp_call*/
22589  __pyx_memoryview___str__, /*tp_str*/
22590  0, /*tp_getattro*/
22591  0, /*tp_setattro*/
22592  &__pyx_tp_as_buffer_memoryview, /*tp_as_buffer*/
22593  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
22594  0, /*tp_doc*/
22595  __pyx_tp_traverse_memoryview, /*tp_traverse*/
22596  __pyx_tp_clear_memoryview, /*tp_clear*/
22597  0, /*tp_richcompare*/
22598  0, /*tp_weaklistoffset*/
22599  0, /*tp_iter*/
22600  0, /*tp_iternext*/
22601  __pyx_methods_memoryview, /*tp_methods*/
22602  0, /*tp_members*/
22603  __pyx_getsets_memoryview, /*tp_getset*/
22604  0, /*tp_base*/
22605  0, /*tp_dict*/
22606  0, /*tp_descr_get*/
22607  0, /*tp_descr_set*/
22608  0, /*tp_dictoffset*/
22609  0, /*tp_init*/
22610  0, /*tp_alloc*/
22611  __pyx_tp_new_memoryview, /*tp_new*/
22612  0, /*tp_free*/
22613  0, /*tp_is_gc*/
22614  0, /*tp_bases*/
22615  0, /*tp_mro*/
22616  0, /*tp_cache*/
22617  0, /*tp_subclasses*/
22618  0, /*tp_weaklist*/
22619  0, /*tp_del*/
22620  0, /*tp_version_tag*/
22621  #if PY_VERSION_HEX >= 0x030400a1
22622  0, /*tp_finalize*/
22623  #endif
22624 };
22625 static struct __pyx_vtabstruct__memoryviewslice __pyx_vtable__memoryviewslice;
22626 
22627 static PyObject *__pyx_tp_new__memoryviewslice(PyTypeObject *t, PyObject *a, PyObject *k) {
22628  struct __pyx_memoryviewslice_obj *p;
22629  PyObject *o = __pyx_tp_new_memoryview(t, a, k);
22630  if (unlikely(!o)) return 0;
22631  p = ((struct __pyx_memoryviewslice_obj *)o);
22632  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_memoryview*)__pyx_vtabptr__memoryviewslice;
22633  p->from_object = Py_None; Py_INCREF(Py_None);
22634  p->from_slice.memview = NULL;
22635  return o;
22636 }
22637 
22638 static void __pyx_tp_dealloc__memoryviewslice(PyObject *o) {
22639  struct __pyx_memoryviewslice_obj *p = (struct __pyx_memoryviewslice_obj *)o;
22640  #if CYTHON_USE_TP_FINALIZE
22641  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
22642  if (PyObject_CallFinalizerFromDealloc(o)) return;
22643  }
22644  #endif
22645  PyObject_GC_UnTrack(o);
22646  {
22647  PyObject *etype, *eval, *etb;
22648  PyErr_Fetch(&etype, &eval, &etb);
22649  ++Py_REFCNT(o);
22650  __pyx_memoryviewslice___dealloc__(o);
22651  --Py_REFCNT(o);
22652  PyErr_Restore(etype, eval, etb);
22653  }
22654  Py_CLEAR(p->from_object);
22655  PyObject_GC_Track(o);
22656  __pyx_tp_dealloc_memoryview(o);
22657 }
22658 
22659 static int __pyx_tp_traverse__memoryviewslice(PyObject *o, visitproc v, void *a) {
22660  int e;
22661  struct __pyx_memoryviewslice_obj *p = (struct __pyx_memoryviewslice_obj *)o;
22662  e = __pyx_tp_traverse_memoryview(o, v, a); if (e) return e;
22663  if (p->from_object) {
22664  e = (*v)(p->from_object, a); if (e) return e;
22665  }
22666  return 0;
22667 }
22668 
22669 static int __pyx_tp_clear__memoryviewslice(PyObject *o) {
22670  PyObject* tmp;
22671  struct __pyx_memoryviewslice_obj *p = (struct __pyx_memoryviewslice_obj *)o;
22672  __pyx_tp_clear_memoryview(o);
22673  tmp = ((PyObject*)p->from_object);
22674  p->from_object = Py_None; Py_INCREF(Py_None);
22675  Py_XDECREF(tmp);
22676  __PYX_XDEC_MEMVIEW(&p->from_slice, 1);
22677  return 0;
22678 }
22679 
22680 static PyObject *__pyx_getprop___pyx_memoryviewslice_base(PyObject *o, CYTHON_UNUSED void *x) {
22681  return __pyx_pw_15View_dot_MemoryView_16_memoryviewslice_4base_1__get__(o);
22682 }
22683 
22684 static PyMethodDef __pyx_methods__memoryviewslice[] = {
22685  {"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_memoryviewslice_1__reduce_cython__, METH_NOARGS, 0},
22686  {"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_memoryviewslice_3__setstate_cython__, METH_O, 0},
22687  {0, 0, 0, 0}
22688 };
22689 
22690 static struct PyGetSetDef __pyx_getsets__memoryviewslice[] = {
22691  {(char *)"base", __pyx_getprop___pyx_memoryviewslice_base, 0, (char *)0, 0},
22692  {0, 0, 0, 0, 0}
22693 };
22694 
22695 static PyTypeObject __pyx_type___pyx_memoryviewslice = {
22696  PyVarObject_HEAD_INIT(0, 0)
22697  "cpartitioning._memoryviewslice", /*tp_name*/
22698  sizeof(struct __pyx_memoryviewslice_obj), /*tp_basicsize*/
22699  0, /*tp_itemsize*/
22700  __pyx_tp_dealloc__memoryviewslice, /*tp_dealloc*/
22701  0, /*tp_print*/
22702  0, /*tp_getattr*/
22703  0, /*tp_setattr*/
22704  #if PY_MAJOR_VERSION < 3
22705  0, /*tp_compare*/
22706  #endif
22707  #if PY_MAJOR_VERSION >= 3
22708  0, /*tp_as_async*/
22709  #endif
22710  #if CYTHON_COMPILING_IN_PYPY
22711  __pyx_memoryview___repr__, /*tp_repr*/
22712  #else
22713  0, /*tp_repr*/
22714  #endif
22715  0, /*tp_as_number*/
22716  0, /*tp_as_sequence*/
22717  0, /*tp_as_mapping*/
22718  0, /*tp_hash*/
22719  0, /*tp_call*/
22720  #if CYTHON_COMPILING_IN_PYPY
22721  __pyx_memoryview___str__, /*tp_str*/
22722  #else
22723  0, /*tp_str*/
22724  #endif
22725  0, /*tp_getattro*/
22726  0, /*tp_setattro*/
22727  0, /*tp_as_buffer*/
22728  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
22729  "Internal class for passing memoryview slices to Python", /*tp_doc*/
22730  __pyx_tp_traverse__memoryviewslice, /*tp_traverse*/
22731  __pyx_tp_clear__memoryviewslice, /*tp_clear*/
22732  0, /*tp_richcompare*/
22733  0, /*tp_weaklistoffset*/
22734  0, /*tp_iter*/
22735  0, /*tp_iternext*/
22736  __pyx_methods__memoryviewslice, /*tp_methods*/
22737  0, /*tp_members*/
22738  __pyx_getsets__memoryviewslice, /*tp_getset*/
22739  0, /*tp_base*/
22740  0, /*tp_dict*/
22741  0, /*tp_descr_get*/
22742  0, /*tp_descr_set*/
22743  0, /*tp_dictoffset*/
22744  0, /*tp_init*/
22745  0, /*tp_alloc*/
22746  __pyx_tp_new__memoryviewslice, /*tp_new*/
22747  0, /*tp_free*/
22748  0, /*tp_is_gc*/
22749  0, /*tp_bases*/
22750  0, /*tp_mro*/
22751  0, /*tp_cache*/
22752  0, /*tp_subclasses*/
22753  0, /*tp_weaklist*/
22754  0, /*tp_del*/
22755  0, /*tp_version_tag*/
22756  #if PY_VERSION_HEX >= 0x030400a1
22757  0, /*tp_finalize*/
22758  #endif
22759 };
22760 
22761 static PyMethodDef __pyx_methods[] = {
22762  {0, 0, 0, 0}
22763 };
22764 
22765 #if PY_MAJOR_VERSION >= 3
22766 #if CYTHON_PEP489_MULTI_PHASE_INIT
22767 static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/
22768 static int __pyx_pymod_exec_cpartitioning(PyObject* module); /*proto*/
22769 static PyModuleDef_Slot __pyx_moduledef_slots[] = {
22770  {Py_mod_create, (void*)__pyx_pymod_create},
22771  {Py_mod_exec, (void*)__pyx_pymod_exec_cpartitioning},
22772  {0, NULL}
22773 };
22774 #endif
22775 
22776 static struct PyModuleDef __pyx_moduledef = {
22777  PyModuleDef_HEAD_INIT,
22778  "cpartitioning",
22779  0, /* m_doc */
22780  #if CYTHON_PEP489_MULTI_PHASE_INIT
22781  0, /* m_size */
22782  #else
22783  -1, /* m_size */
22784  #endif
22785  __pyx_methods /* m_methods */,
22786  #if CYTHON_PEP489_MULTI_PHASE_INIT
22787  __pyx_moduledef_slots, /* m_slots */
22788  #else
22789  NULL, /* m_reload */
22790  #endif
22791  NULL, /* m_traverse */
22792  NULL, /* m_clear */
22793  NULL /* m_free */
22794 };
22795 #endif
22796 #ifndef CYTHON_SMALL_CODE
22797 #if defined(__clang__)
22798  #define CYTHON_SMALL_CODE
22799 #elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3))
22800  #define CYTHON_SMALL_CODE __attribute__((cold))
22801 #else
22802  #define CYTHON_SMALL_CODE
22803 #endif
22804 #endif
22805 
22806 static __Pyx_StringTabEntry __pyx_string_tab[] = {
22807  {&__pyx_n_s_ASCII, __pyx_k_ASCII, sizeof(__pyx_k_ASCII), 0, 0, 1, 1},
22808  {&__pyx_kp_s_Buffer_view_does_not_expose_stri, __pyx_k_Buffer_view_does_not_expose_stri, sizeof(__pyx_k_Buffer_view_does_not_expose_stri), 0, 0, 1, 0},
22809  {&__pyx_kp_s_Can_only_create_a_buffer_that_is, __pyx_k_Can_only_create_a_buffer_that_is, sizeof(__pyx_k_Can_only_create_a_buffer_that_is), 0, 0, 1, 0},
22810  {&__pyx_kp_s_Cannot_assign_to_read_only_memor, __pyx_k_Cannot_assign_to_read_only_memor, sizeof(__pyx_k_Cannot_assign_to_read_only_memor), 0, 0, 1, 0},
22811  {&__pyx_kp_s_Cannot_create_writable_memory_vi, __pyx_k_Cannot_create_writable_memory_vi, sizeof(__pyx_k_Cannot_create_writable_memory_vi), 0, 0, 1, 0},
22812  {&__pyx_kp_s_Cannot_index_with_type_s, __pyx_k_Cannot_index_with_type_s, sizeof(__pyx_k_Cannot_index_with_type_s), 0, 0, 1, 0},
22813  {&__pyx_n_s_Comm, __pyx_k_Comm, sizeof(__pyx_k_Comm), 0, 0, 1, 1},
22814  {&__pyx_n_s_Ellipsis, __pyx_k_Ellipsis, sizeof(__pyx_k_Ellipsis), 0, 0, 1, 1},
22815  {&__pyx_kp_s_Empty_shape_tuple_for_cython_arr, __pyx_k_Empty_shape_tuple_for_cython_arr, sizeof(__pyx_k_Empty_shape_tuple_for_cython_arr), 0, 0, 1, 0},
22816  {&__pyx_kp_u_Format_string_allocated_too_shor, __pyx_k_Format_string_allocated_too_shor, sizeof(__pyx_k_Format_string_allocated_too_shor), 0, 1, 0, 0},
22817  {&__pyx_kp_u_Format_string_allocated_too_shor_2, __pyx_k_Format_string_allocated_too_shor_2, sizeof(__pyx_k_Format_string_allocated_too_shor_2), 0, 1, 0, 0},
22818  {&__pyx_n_s_ImportError, __pyx_k_ImportError, sizeof(__pyx_k_ImportError), 0, 0, 1, 1},
22819  {&__pyx_kp_s_Incompatible_checksums_s_vs_0xb0, __pyx_k_Incompatible_checksums_s_vs_0xb0, sizeof(__pyx_k_Incompatible_checksums_s_vs_0xb0), 0, 0, 1, 0},
22820  {&__pyx_n_s_IndexError, __pyx_k_IndexError, sizeof(__pyx_k_IndexError), 0, 0, 1, 1},
22821  {&__pyx_kp_s_Indirect_dimensions_not_supporte, __pyx_k_Indirect_dimensions_not_supporte, sizeof(__pyx_k_Indirect_dimensions_not_supporte), 0, 0, 1, 0},
22822  {&__pyx_kp_s_Invalid_mode_expected_c_or_fortr, __pyx_k_Invalid_mode_expected_c_or_fortr, sizeof(__pyx_k_Invalid_mode_expected_c_or_fortr), 0, 0, 1, 0},
22823  {&__pyx_kp_s_Invalid_shape_in_axis_d_d, __pyx_k_Invalid_shape_in_axis_d_d, sizeof(__pyx_k_Invalid_shape_in_axis_d_d), 0, 0, 1, 0},
22824  {&__pyx_n_s_MemoryError, __pyx_k_MemoryError, sizeof(__pyx_k_MemoryError), 0, 0, 1, 1},
22825  {&__pyx_kp_s_MemoryView_of_r_at_0x_x, __pyx_k_MemoryView_of_r_at_0x_x, sizeof(__pyx_k_MemoryView_of_r_at_0x_x), 0, 0, 1, 0},
22826  {&__pyx_kp_s_MemoryView_of_r_object, __pyx_k_MemoryView_of_r_object, sizeof(__pyx_k_MemoryView_of_r_object), 0, 0, 1, 0},
22827  {&__pyx_kp_u_Non_native_byte_order_not_suppor, __pyx_k_Non_native_byte_order_not_suppor, sizeof(__pyx_k_Non_native_byte_order_not_suppor), 0, 1, 0, 0},
22828  {&__pyx_n_b_O, __pyx_k_O, sizeof(__pyx_k_O), 0, 0, 0, 1},
22829  {&__pyx_kp_s_Out_of_bounds_on_buffer_access_a, __pyx_k_Out_of_bounds_on_buffer_access_a, sizeof(__pyx_k_Out_of_bounds_on_buffer_access_a), 0, 0, 1, 0},
22830  {&__pyx_n_s_PickleError, __pyx_k_PickleError, sizeof(__pyx_k_PickleError), 0, 0, 1, 1},
22831  {&__pyx_n_s_RuntimeError, __pyx_k_RuntimeError, sizeof(__pyx_k_RuntimeError), 0, 0, 1, 1},
22832  {&__pyx_kp_b_T, __pyx_k_T, sizeof(__pyx_k_T), 0, 0, 0, 0},
22833  {&__pyx_n_s_TypeError, __pyx_k_TypeError, sizeof(__pyx_k_TypeError), 0, 0, 1, 1},
22834  {&__pyx_kp_s_Unable_to_convert_item_to_object, __pyx_k_Unable_to_convert_item_to_object, sizeof(__pyx_k_Unable_to_convert_item_to_object), 0, 0, 1, 0},
22835  {&__pyx_n_s_ValueError, __pyx_k_ValueError, sizeof(__pyx_k_ValueError), 0, 0, 1, 1},
22836  {&__pyx_n_s_View_MemoryView, __pyx_k_View_MemoryView, sizeof(__pyx_k_View_MemoryView), 0, 0, 1, 1},
22837  {&__pyx_kp_b__26, __pyx_k__26, sizeof(__pyx_k__26), 0, 0, 0, 0},
22838  {&__pyx_kp_b__27, __pyx_k__27, sizeof(__pyx_k__27), 0, 0, 0, 0},
22839  {&__pyx_kp_b__28, __pyx_k__28, sizeof(__pyx_k__28), 0, 0, 0, 0},
22840  {&__pyx_kp_b__29, __pyx_k__29, sizeof(__pyx_k__29), 0, 0, 0, 0},
22841  {&__pyx_kp_u__30, __pyx_k__30, sizeof(__pyx_k__30), 0, 1, 0, 0},
22842  {&__pyx_n_s_allocate_buffer, __pyx_k_allocate_buffer, sizeof(__pyx_k_allocate_buffer), 0, 0, 1, 1},
22843  {&__pyx_n_s_asarray, __pyx_k_asarray, sizeof(__pyx_k_asarray), 0, 0, 1, 1},
22844  {&__pyx_n_s_base, __pyx_k_base, sizeof(__pyx_k_base), 0, 0, 1, 1},
22845  {&__pyx_n_s_buildDiscontinuousGalerkinLocal2, __pyx_k_buildDiscontinuousGalerkinLocal2, sizeof(__pyx_k_buildDiscontinuousGalerkinLocal2), 0, 0, 1, 1},
22846  {&__pyx_n_s_buildQuadraticCubeLocal2GlobalMa, __pyx_k_buildQuadraticCubeLocal2GlobalMa, sizeof(__pyx_k_buildQuadraticCubeLocal2GlobalMa), 0, 0, 1, 1},
22847  {&__pyx_kp_s_buildQuadraticCubeSubdomain2Glob, __pyx_k_buildQuadraticCubeSubdomain2Glob, sizeof(__pyx_k_buildQuadraticCubeSubdomain2Glob), 0, 0, 1, 0},
22848  {&__pyx_kp_s_buildQuadraticCubeSubdomain2Glob_2, __pyx_k_buildQuadraticCubeSubdomain2Glob_2, sizeof(__pyx_k_buildQuadraticCubeSubdomain2Glob_2), 0, 0, 1, 0},
22849  {&__pyx_n_s_buildQuadraticLocal2GlobalMappin, __pyx_k_buildQuadraticLocal2GlobalMappin, sizeof(__pyx_k_buildQuadraticLocal2GlobalMappin), 0, 0, 1, 1},
22850  {&__pyx_n_s_c, __pyx_k_c, sizeof(__pyx_k_c), 0, 0, 1, 1},
22851  {&__pyx_n_u_c, __pyx_k_c, sizeof(__pyx_k_c), 0, 1, 0, 1},
22852  {&__pyx_n_s_class, __pyx_k_class, sizeof(__pyx_k_class), 0, 0, 1, 1},
22853  {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1},
22854  {&__pyx_n_s_cmesh, __pyx_k_cmesh, sizeof(__pyx_k_cmesh), 0, 0, 1, 1},
22855  {&__pyx_n_s_comm, __pyx_k_comm, sizeof(__pyx_k_comm), 0, 0, 1, 1},
22856  {&__pyx_kp_s_contiguous_and_direct, __pyx_k_contiguous_and_direct, sizeof(__pyx_k_contiguous_and_direct), 0, 0, 1, 0},
22857  {&__pyx_kp_s_contiguous_and_indirect, __pyx_k_contiguous_and_indirect, sizeof(__pyx_k_contiguous_and_indirect), 0, 0, 1, 0},
22858  {&__pyx_n_s_convertPUMIPartitionToPython, __pyx_k_convertPUMIPartitionToPython, sizeof(__pyx_k_convertPUMIPartitionToPython), 0, 0, 1, 1},
22859  {&__pyx_n_s_cpartitioning, __pyx_k_cpartitioning, sizeof(__pyx_k_cpartitioning), 0, 0, 1, 1},
22860  {&__pyx_n_s_dgNumbering_subdomain2global, __pyx_k_dgNumbering_subdomain2global, sizeof(__pyx_k_dgNumbering_subdomain2global), 0, 0, 1, 1},
22861  {&__pyx_n_s_dg_dof_offsets_subdomain_owned, __pyx_k_dg_dof_offsets_subdomain_owned, sizeof(__pyx_k_dg_dof_offsets_subdomain_owned), 0, 0, 1, 1},
22862  {&__pyx_n_s_dg_subdomain_l2g, __pyx_k_dg_subdomain_l2g, sizeof(__pyx_k_dg_subdomain_l2g), 0, 0, 1, 1},
22863  {&__pyx_n_s_dict, __pyx_k_dict, sizeof(__pyx_k_dict), 0, 0, 1, 1},
22864  {&__pyx_n_s_dtype_is_object, __pyx_k_dtype_is_object, sizeof(__pyx_k_dtype_is_object), 0, 0, 1, 1},
22865  {&__pyx_n_s_edgeNumbering_subdomain2global, __pyx_k_edgeNumbering_subdomain2global, sizeof(__pyx_k_edgeNumbering_subdomain2global), 0, 0, 1, 1},
22866  {&__pyx_n_s_edgeOffsets_subdomain_owned, __pyx_k_edgeOffsets_subdomain_owned, sizeof(__pyx_k_edgeOffsets_subdomain_owned), 0, 0, 1, 1},
22867  {&__pyx_n_s_elementBoundaryNumbering_subdoma, __pyx_k_elementBoundaryNumbering_subdoma, sizeof(__pyx_k_elementBoundaryNumbering_subdoma), 0, 0, 1, 1},
22868  {&__pyx_n_s_elementBoundaryOffsets_subdomain, __pyx_k_elementBoundaryOffsets_subdomain, sizeof(__pyx_k_elementBoundaryOffsets_subdomain), 0, 0, 1, 1},
22869  {&__pyx_n_s_elementNumbering_subdomain2globa, __pyx_k_elementNumbering_subdomain2globa, sizeof(__pyx_k_elementNumbering_subdomain2globa), 0, 0, 1, 1},
22870  {&__pyx_n_s_elementOffsets_subdomain_owned, __pyx_k_elementOffsets_subdomain_owned, sizeof(__pyx_k_elementOffsets_subdomain_owned), 0, 0, 1, 1},
22871  {&__pyx_n_s_encode, __pyx_k_encode, sizeof(__pyx_k_encode), 0, 0, 1, 1},
22872  {&__pyx_n_s_enumerate, __pyx_k_enumerate, sizeof(__pyx_k_enumerate), 0, 0, 1, 1},
22873  {&__pyx_n_s_error, __pyx_k_error, sizeof(__pyx_k_error), 0, 0, 1, 1},
22874  {&__pyx_n_s_filebase, __pyx_k_filebase, sizeof(__pyx_k_filebase), 0, 0, 1, 1},
22875  {&__pyx_n_s_flags, __pyx_k_flags, sizeof(__pyx_k_flags), 0, 0, 1, 1},
22876  {&__pyx_n_s_format, __pyx_k_format, sizeof(__pyx_k_format), 0, 0, 1, 1},
22877  {&__pyx_n_s_fortran, __pyx_k_fortran, sizeof(__pyx_k_fortran), 0, 0, 1, 1},
22878  {&__pyx_n_u_fortran, __pyx_k_fortran, sizeof(__pyx_k_fortran), 0, 1, 0, 1},
22879  {&__pyx_n_s_getstate, __pyx_k_getstate, sizeof(__pyx_k_getstate), 0, 0, 1, 1},
22880  {&__pyx_kp_s_got_differing_extents_in_dimensi, __pyx_k_got_differing_extents_in_dimensi, sizeof(__pyx_k_got_differing_extents_in_dimensi), 0, 0, 1, 0},
22881  {&__pyx_n_s_id, __pyx_k_id, sizeof(__pyx_k_id), 0, 0, 1, 1},
22882  {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1},
22883  {&__pyx_n_s_indexBase, __pyx_k_indexBase, sizeof(__pyx_k_indexBase), 0, 0, 1, 1},
22884  {&__pyx_n_s_itemsize, __pyx_k_itemsize, sizeof(__pyx_k_itemsize), 0, 0, 1, 1},
22885  {&__pyx_kp_s_itemsize_0_for_cython_array, __pyx_k_itemsize_0_for_cython_array, sizeof(__pyx_k_itemsize_0_for_cython_array), 0, 0, 1, 0},
22886  {&__pyx_n_s_join, __pyx_k_join, sizeof(__pyx_k_join), 0, 0, 1, 1},
22887  {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1},
22888  {&__pyx_n_s_max_dof_neighbors, __pyx_k_max_dof_neighbors, sizeof(__pyx_k_max_dof_neighbors), 0, 0, 1, 1},
22889  {&__pyx_n_s_memview, __pyx_k_memview, sizeof(__pyx_k_memview), 0, 0, 1, 1},
22890  {&__pyx_n_s_mode, __pyx_k_mode, sizeof(__pyx_k_mode), 0, 0, 1, 1},
22891  {&__pyx_n_s_nDOF_all_processes, __pyx_k_nDOF_all_processes, sizeof(__pyx_k_nDOF_all_processes), 0, 0, 1, 1},
22892  {&__pyx_n_s_nDOF_element, __pyx_k_nDOF_element, sizeof(__pyx_k_nDOF_element), 0, 0, 1, 1},
22893  {&__pyx_n_s_nDOF_subdomain, __pyx_k_nDOF_subdomain, sizeof(__pyx_k_nDOF_subdomain), 0, 0, 1, 1},
22894  {&__pyx_n_s_nLayersOfOverlap, __pyx_k_nLayersOfOverlap, sizeof(__pyx_k_nLayersOfOverlap), 0, 0, 1, 1},
22895  {&__pyx_n_s_nSpace, __pyx_k_nSpace, sizeof(__pyx_k_nSpace), 0, 0, 1, 1},
22896  {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1},
22897  {&__pyx_n_s_name_2, __pyx_k_name_2, sizeof(__pyx_k_name_2), 0, 0, 1, 1},
22898  {&__pyx_kp_u_ndarray_is_not_C_contiguous, __pyx_k_ndarray_is_not_C_contiguous, sizeof(__pyx_k_ndarray_is_not_C_contiguous), 0, 1, 0, 0},
22899  {&__pyx_kp_u_ndarray_is_not_Fortran_contiguou, __pyx_k_ndarray_is_not_Fortran_contiguou, sizeof(__pyx_k_ndarray_is_not_Fortran_contiguou), 0, 1, 0, 0},
22900  {&__pyx_n_s_ndim, __pyx_k_ndim, sizeof(__pyx_k_ndim), 0, 0, 1, 1},
22901  {&__pyx_n_s_new, __pyx_k_new, sizeof(__pyx_k_new), 0, 0, 1, 1},
22902  {&__pyx_kp_s_no_default___reduce___due_to_non, __pyx_k_no_default___reduce___due_to_non, sizeof(__pyx_k_no_default___reduce___due_to_non), 0, 0, 1, 0},
22903  {&__pyx_n_s_nodeNumbering_subdomain2global, __pyx_k_nodeNumbering_subdomain2global, sizeof(__pyx_k_nodeNumbering_subdomain2global), 0, 0, 1, 1},
22904  {&__pyx_n_s_nodeOffsets_subdomain_owned, __pyx_k_nodeOffsets_subdomain_owned, sizeof(__pyx_k_nodeOffsets_subdomain_owned), 0, 0, 1, 1},
22905  {&__pyx_n_s_np, __pyx_k_np, sizeof(__pyx_k_np), 0, 0, 1, 1},
22906  {&__pyx_n_s_numpy, __pyx_k_numpy, sizeof(__pyx_k_numpy), 0, 0, 1, 1},
22907  {&__pyx_kp_s_numpy_core_multiarray_failed_to, __pyx_k_numpy_core_multiarray_failed_to, sizeof(__pyx_k_numpy_core_multiarray_failed_to), 0, 0, 1, 0},
22908  {&__pyx_kp_s_numpy_core_umath_failed_to_impor, __pyx_k_numpy_core_umath_failed_to_impor, sizeof(__pyx_k_numpy_core_umath_failed_to_impor), 0, 0, 1, 0},
22909  {&__pyx_n_s_obj, __pyx_k_obj, sizeof(__pyx_k_obj), 0, 0, 1, 1},
22910  {&__pyx_n_s_pack, __pyx_k_pack, sizeof(__pyx_k_pack), 0, 0, 1, 1},
22911  {&__pyx_n_s_partitionElements, __pyx_k_partitionElements, sizeof(__pyx_k_partitionElements), 0, 0, 1, 1},
22912  {&__pyx_n_s_partitionNodes, __pyx_k_partitionNodes, sizeof(__pyx_k_partitionNodes), 0, 0, 1, 1},
22913  {&__pyx_n_s_partitionNodesFromTetgenFiles, __pyx_k_partitionNodesFromTetgenFiles, sizeof(__pyx_k_partitionNodesFromTetgenFiles), 0, 0, 1, 1},
22914  {&__pyx_n_s_pickle, __pyx_k_pickle, sizeof(__pyx_k_pickle), 0, 0, 1, 1},
22915  {&__pyx_n_s_proteus, __pyx_k_proteus, sizeof(__pyx_k_proteus), 0, 0, 1, 1},
22916  {&__pyx_n_s_proteus_Comm, __pyx_k_proteus_Comm, sizeof(__pyx_k_proteus_Comm), 0, 0, 1, 1},
22917  {&__pyx_kp_s_proteus_cpartitioning_pyx, __pyx_k_proteus_cpartitioning_pyx, sizeof(__pyx_k_proteus_cpartitioning_pyx), 0, 0, 1, 0},
22918  {&__pyx_n_s_pyx_PickleError, __pyx_k_pyx_PickleError, sizeof(__pyx_k_pyx_PickleError), 0, 0, 1, 1},
22919  {&__pyx_n_s_pyx_checksum, __pyx_k_pyx_checksum, sizeof(__pyx_k_pyx_checksum), 0, 0, 1, 1},
22920  {&__pyx_n_s_pyx_getbuffer, __pyx_k_pyx_getbuffer, sizeof(__pyx_k_pyx_getbuffer), 0, 0, 1, 1},
22921  {&__pyx_n_s_pyx_result, __pyx_k_pyx_result, sizeof(__pyx_k_pyx_result), 0, 0, 1, 1},
22922  {&__pyx_n_s_pyx_state, __pyx_k_pyx_state, sizeof(__pyx_k_pyx_state), 0, 0, 1, 1},
22923  {&__pyx_n_s_pyx_type, __pyx_k_pyx_type, sizeof(__pyx_k_pyx_type), 0, 0, 1, 1},
22924  {&__pyx_n_s_pyx_unpickle_Enum, __pyx_k_pyx_unpickle_Enum, sizeof(__pyx_k_pyx_unpickle_Enum), 0, 0, 1, 1},
22925  {&__pyx_n_s_pyx_vtable, __pyx_k_pyx_vtable, sizeof(__pyx_k_pyx_vtable), 0, 0, 1, 1},
22926  {&__pyx_n_s_quadraticNumbering_subdomain2glo, __pyx_k_quadraticNumbering_subdomain2glo, sizeof(__pyx_k_quadraticNumbering_subdomain2glo), 0, 0, 1, 1},
22927  {&__pyx_n_s_quadratic_dof_offsets_subdomain, __pyx_k_quadratic_dof_offsets_subdomain, sizeof(__pyx_k_quadratic_dof_offsets_subdomain), 0, 0, 1, 1},
22928  {&__pyx_n_s_quadratic_lagrangeNodes, __pyx_k_quadratic_lagrangeNodes, sizeof(__pyx_k_quadratic_lagrangeNodes), 0, 0, 1, 1},
22929  {&__pyx_n_s_quadratic_subdomain_l2g, __pyx_k_quadratic_subdomain_l2g, sizeof(__pyx_k_quadratic_subdomain_l2g), 0, 0, 1, 1},
22930  {&__pyx_n_s_range, __pyx_k_range, sizeof(__pyx_k_range), 0, 0, 1, 1},
22931  {&__pyx_n_s_reduce, __pyx_k_reduce, sizeof(__pyx_k_reduce), 0, 0, 1, 1},
22932  {&__pyx_n_s_reduce_cython, __pyx_k_reduce_cython, sizeof(__pyx_k_reduce_cython), 0, 0, 1, 1},
22933  {&__pyx_n_s_reduce_ex, __pyx_k_reduce_ex, sizeof(__pyx_k_reduce_ex), 0, 0, 1, 1},
22934  {&__pyx_kp_u_s, __pyx_k_s, sizeof(__pyx_k_s), 0, 1, 0, 0},
22935  {&__pyx_n_s_setstate, __pyx_k_setstate, sizeof(__pyx_k_setstate), 0, 0, 1, 1},
22936  {&__pyx_n_s_setstate_cython, __pyx_k_setstate_cython, sizeof(__pyx_k_setstate_cython), 0, 0, 1, 1},
22937  {&__pyx_n_s_shape, __pyx_k_shape, sizeof(__pyx_k_shape), 0, 0, 1, 1},
22938  {&__pyx_n_s_size, __pyx_k_size, sizeof(__pyx_k_size), 0, 0, 1, 1},
22939  {&__pyx_n_s_start, __pyx_k_start, sizeof(__pyx_k_start), 0, 0, 1, 1},
22940  {&__pyx_n_s_step, __pyx_k_step, sizeof(__pyx_k_step), 0, 0, 1, 1},
22941  {&__pyx_n_s_stop, __pyx_k_stop, sizeof(__pyx_k_stop), 0, 0, 1, 1},
22942  {&__pyx_kp_s_strided_and_direct, __pyx_k_strided_and_direct, sizeof(__pyx_k_strided_and_direct), 0, 0, 1, 0},
22943  {&__pyx_kp_s_strided_and_direct_or_indirect, __pyx_k_strided_and_direct_or_indirect, sizeof(__pyx_k_strided_and_direct_or_indirect), 0, 0, 1, 0},
22944  {&__pyx_kp_s_strided_and_indirect, __pyx_k_strided_and_indirect, sizeof(__pyx_k_strided_and_indirect), 0, 0, 1, 0},
22945  {&__pyx_kp_s_stringsource, __pyx_k_stringsource, sizeof(__pyx_k_stringsource), 0, 0, 1, 0},
22946  {&__pyx_n_s_struct, __pyx_k_struct, sizeof(__pyx_k_struct), 0, 0, 1, 1},
22947  {&__pyx_n_s_subdomain_cmesh, __pyx_k_subdomain_cmesh, sizeof(__pyx_k_subdomain_cmesh), 0, 0, 1, 1},
22948  {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1},
22949  {&__pyx_kp_s_unable_to_allocate_array_data, __pyx_k_unable_to_allocate_array_data, sizeof(__pyx_k_unable_to_allocate_array_data), 0, 0, 1, 0},
22950  {&__pyx_kp_s_unable_to_allocate_shape_and_str, __pyx_k_unable_to_allocate_shape_and_str, sizeof(__pyx_k_unable_to_allocate_shape_and_str), 0, 0, 1, 0},
22951  {&__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_k_unknown_dtype_code_in_numpy_pxd, sizeof(__pyx_k_unknown_dtype_code_in_numpy_pxd), 0, 1, 0, 0},
22952  {&__pyx_n_s_unpack, __pyx_k_unpack, sizeof(__pyx_k_unpack), 0, 0, 1, 1},
22953  {&__pyx_n_s_update, __pyx_k_update, sizeof(__pyx_k_update), 0, 0, 1, 1},
22954  {0, 0, 0, 0, 0, 0, 0}
22955 };
22956 static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) {
22957  __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(1, 272, __pyx_L1_error)
22958  __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) __PYX_ERR(1, 285, __pyx_L1_error)
22959  __pyx_builtin_RuntimeError = __Pyx_GetBuiltinName(__pyx_n_s_RuntimeError); if (!__pyx_builtin_RuntimeError) __PYX_ERR(1, 856, __pyx_L1_error)
22960  __pyx_builtin_ImportError = __Pyx_GetBuiltinName(__pyx_n_s_ImportError); if (!__pyx_builtin_ImportError) __PYX_ERR(1, 1038, __pyx_L1_error)
22961  __pyx_builtin_MemoryError = __Pyx_GetBuiltinName(__pyx_n_s_MemoryError); if (!__pyx_builtin_MemoryError) __PYX_ERR(2, 148, __pyx_L1_error)
22962  __pyx_builtin_enumerate = __Pyx_GetBuiltinName(__pyx_n_s_enumerate); if (!__pyx_builtin_enumerate) __PYX_ERR(2, 151, __pyx_L1_error)
22963  __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) __PYX_ERR(2, 2, __pyx_L1_error)
22964  __pyx_builtin_Ellipsis = __Pyx_GetBuiltinName(__pyx_n_s_Ellipsis); if (!__pyx_builtin_Ellipsis) __PYX_ERR(2, 400, __pyx_L1_error)
22965  __pyx_builtin_id = __Pyx_GetBuiltinName(__pyx_n_s_id); if (!__pyx_builtin_id) __PYX_ERR(2, 609, __pyx_L1_error)
22966  __pyx_builtin_IndexError = __Pyx_GetBuiltinName(__pyx_n_s_IndexError); if (!__pyx_builtin_IndexError) __PYX_ERR(2, 828, __pyx_L1_error)
22967  return 0;
22968  __pyx_L1_error:;
22969  return -1;
22970 }
22971 
22972 static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) {
22973  __Pyx_RefNannyDeclarations
22974  __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0);
22975 
22976  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":272
22977  * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)
22978  * and not PyArray_CHKFLAGS(self, NPY_ARRAY_C_CONTIGUOUS)):
22979  * raise ValueError(u"ndarray is not C contiguous") # <<<<<<<<<<<<<<
22980  *
22981  * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)
22982  */
22983  __pyx_tuple_ = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_C_contiguous); if (unlikely(!__pyx_tuple_)) __PYX_ERR(1, 272, __pyx_L1_error)
22984  __Pyx_GOTREF(__pyx_tuple_);
22985  __Pyx_GIVEREF(__pyx_tuple_);
22986 
22987  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":276
22988  * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)
22989  * and not PyArray_CHKFLAGS(self, NPY_ARRAY_F_CONTIGUOUS)):
22990  * raise ValueError(u"ndarray is not Fortran contiguous") # <<<<<<<<<<<<<<
22991  *
22992  * info.buf = PyArray_DATA(self)
22993  */
22994  __pyx_tuple__2 = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_Fortran_contiguou); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(1, 276, __pyx_L1_error)
22995  __Pyx_GOTREF(__pyx_tuple__2);
22996  __Pyx_GIVEREF(__pyx_tuple__2);
22997 
22998  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":306
22999  * if ((descr.byteorder == c'>' and little_endian) or
23000  * (descr.byteorder == c'<' and not little_endian)):
23001  * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<<
23002  * if t == NPY_BYTE: f = "b"
23003  * elif t == NPY_UBYTE: f = "B"
23004  */
23005  __pyx_tuple__3 = PyTuple_Pack(1, __pyx_kp_u_Non_native_byte_order_not_suppor); if (unlikely(!__pyx_tuple__3)) __PYX_ERR(1, 306, __pyx_L1_error)
23006  __Pyx_GOTREF(__pyx_tuple__3);
23007  __Pyx_GIVEREF(__pyx_tuple__3);
23008 
23009  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":856
23010  *
23011  * if (end - f) - <int>(new_offset - offset[0]) < 15:
23012  * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") # <<<<<<<<<<<<<<
23013  *
23014  * if ((child.byteorder == c'>' and little_endian) or
23015  */
23016  __pyx_tuple__4 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(1, 856, __pyx_L1_error)
23017  __Pyx_GOTREF(__pyx_tuple__4);
23018  __Pyx_GIVEREF(__pyx_tuple__4);
23019 
23020  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":880
23021  * t = child.type_num
23022  * if end - f < 5:
23023  * raise RuntimeError(u"Format string allocated too short.") # <<<<<<<<<<<<<<
23024  *
23025  * # Until ticket #99 is fixed, use integers to avoid warnings
23026  */
23027  __pyx_tuple__5 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor_2); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(1, 880, __pyx_L1_error)
23028  __Pyx_GOTREF(__pyx_tuple__5);
23029  __Pyx_GIVEREF(__pyx_tuple__5);
23030 
23031  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1038
23032  * _import_array()
23033  * except Exception:
23034  * raise ImportError("numpy.core.multiarray failed to import") # <<<<<<<<<<<<<<
23035  *
23036  * cdef inline int import_umath() except -1:
23037  */
23038  __pyx_tuple__6 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_multiarray_failed_to); if (unlikely(!__pyx_tuple__6)) __PYX_ERR(1, 1038, __pyx_L1_error)
23039  __Pyx_GOTREF(__pyx_tuple__6);
23040  __Pyx_GIVEREF(__pyx_tuple__6);
23041 
23042  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1044
23043  * _import_umath()
23044  * except Exception:
23045  * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<<
23046  *
23047  * cdef inline int import_ufunc() except -1:
23048  */
23049  __pyx_tuple__7 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_umath_failed_to_impor); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(1, 1044, __pyx_L1_error)
23050  __Pyx_GOTREF(__pyx_tuple__7);
23051  __Pyx_GIVEREF(__pyx_tuple__7);
23052 
23053  /* "View.MemoryView":133
23054  *
23055  * if not self.ndim:
23056  * raise ValueError("Empty shape tuple for cython.array") # <<<<<<<<<<<<<<
23057  *
23058  * if itemsize <= 0:
23059  */
23060  __pyx_tuple__8 = PyTuple_Pack(1, __pyx_kp_s_Empty_shape_tuple_for_cython_arr); if (unlikely(!__pyx_tuple__8)) __PYX_ERR(2, 133, __pyx_L1_error)
23061  __Pyx_GOTREF(__pyx_tuple__8);
23062  __Pyx_GIVEREF(__pyx_tuple__8);
23063 
23064  /* "View.MemoryView":136
23065  *
23066  * if itemsize <= 0:
23067  * raise ValueError("itemsize <= 0 for cython.array") # <<<<<<<<<<<<<<
23068  *
23069  * if not isinstance(format, bytes):
23070  */
23071  __pyx_tuple__9 = PyTuple_Pack(1, __pyx_kp_s_itemsize_0_for_cython_array); if (unlikely(!__pyx_tuple__9)) __PYX_ERR(2, 136, __pyx_L1_error)
23072  __Pyx_GOTREF(__pyx_tuple__9);
23073  __Pyx_GIVEREF(__pyx_tuple__9);
23074 
23075  /* "View.MemoryView":148
23076  *
23077  * if not self._shape:
23078  * raise MemoryError("unable to allocate shape and strides.") # <<<<<<<<<<<<<<
23079  *
23080  *
23081  */
23082  __pyx_tuple__10 = PyTuple_Pack(1, __pyx_kp_s_unable_to_allocate_shape_and_str); if (unlikely(!__pyx_tuple__10)) __PYX_ERR(2, 148, __pyx_L1_error)
23083  __Pyx_GOTREF(__pyx_tuple__10);
23084  __Pyx_GIVEREF(__pyx_tuple__10);
23085 
23086  /* "View.MemoryView":176
23087  * self.data = <char *>malloc(self.len)
23088  * if not self.data:
23089  * raise MemoryError("unable to allocate array data.") # <<<<<<<<<<<<<<
23090  *
23091  * if self.dtype_is_object:
23092  */
23093  __pyx_tuple__11 = PyTuple_Pack(1, __pyx_kp_s_unable_to_allocate_array_data); if (unlikely(!__pyx_tuple__11)) __PYX_ERR(2, 176, __pyx_L1_error)
23094  __Pyx_GOTREF(__pyx_tuple__11);
23095  __Pyx_GIVEREF(__pyx_tuple__11);
23096 
23097  /* "View.MemoryView":192
23098  * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
23099  * if not (flags & bufmode):
23100  * raise ValueError("Can only create a buffer that is contiguous in memory.") # <<<<<<<<<<<<<<
23101  * info.buf = self.data
23102  * info.len = self.len
23103  */
23104  __pyx_tuple__12 = PyTuple_Pack(1, __pyx_kp_s_Can_only_create_a_buffer_that_is); if (unlikely(!__pyx_tuple__12)) __PYX_ERR(2, 192, __pyx_L1_error)
23105  __Pyx_GOTREF(__pyx_tuple__12);
23106  __Pyx_GIVEREF(__pyx_tuple__12);
23107 
23108  /* "(tree fragment)":2
23109  * def __reduce_cython__(self):
23110  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
23111  * def __setstate_cython__(self, __pyx_state):
23112  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
23113  */
23114  __pyx_tuple__13 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__13)) __PYX_ERR(2, 2, __pyx_L1_error)
23115  __Pyx_GOTREF(__pyx_tuple__13);
23116  __Pyx_GIVEREF(__pyx_tuple__13);
23117 
23118  /* "(tree fragment)":4
23119  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
23120  * def __setstate_cython__(self, __pyx_state):
23121  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
23122  */
23123  __pyx_tuple__14 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__14)) __PYX_ERR(2, 4, __pyx_L1_error)
23124  __Pyx_GOTREF(__pyx_tuple__14);
23125  __Pyx_GIVEREF(__pyx_tuple__14);
23126 
23127  /* "View.MemoryView":414
23128  * def __setitem__(memoryview self, object index, object value):
23129  * if self.view.readonly:
23130  * raise TypeError("Cannot assign to read-only memoryview") # <<<<<<<<<<<<<<
23131  *
23132  * have_slices, index = _unellipsify(index, self.view.ndim)
23133  */
23134  __pyx_tuple__15 = PyTuple_Pack(1, __pyx_kp_s_Cannot_assign_to_read_only_memor); if (unlikely(!__pyx_tuple__15)) __PYX_ERR(2, 414, __pyx_L1_error)
23135  __Pyx_GOTREF(__pyx_tuple__15);
23136  __Pyx_GIVEREF(__pyx_tuple__15);
23137 
23138  /* "View.MemoryView":491
23139  * result = struct.unpack(self.view.format, bytesitem)
23140  * except struct.error:
23141  * raise ValueError("Unable to convert item to object") # <<<<<<<<<<<<<<
23142  * else:
23143  * if len(self.view.format) == 1:
23144  */
23145  __pyx_tuple__16 = PyTuple_Pack(1, __pyx_kp_s_Unable_to_convert_item_to_object); if (unlikely(!__pyx_tuple__16)) __PYX_ERR(2, 491, __pyx_L1_error)
23146  __Pyx_GOTREF(__pyx_tuple__16);
23147  __Pyx_GIVEREF(__pyx_tuple__16);
23148 
23149  /* "View.MemoryView":516
23150  * def __getbuffer__(self, Py_buffer *info, int flags):
23151  * if flags & PyBUF_WRITABLE and self.view.readonly:
23152  * raise ValueError("Cannot create writable memory view from read-only memoryview") # <<<<<<<<<<<<<<
23153  *
23154  * if flags & PyBUF_ND:
23155  */
23156  __pyx_tuple__17 = PyTuple_Pack(1, __pyx_kp_s_Cannot_create_writable_memory_vi); if (unlikely(!__pyx_tuple__17)) __PYX_ERR(2, 516, __pyx_L1_error)
23157  __Pyx_GOTREF(__pyx_tuple__17);
23158  __Pyx_GIVEREF(__pyx_tuple__17);
23159 
23160  /* "View.MemoryView":566
23161  * if self.view.strides == NULL:
23162  *
23163  * raise ValueError("Buffer view does not expose strides") # <<<<<<<<<<<<<<
23164  *
23165  * return tuple([stride for stride in self.view.strides[:self.view.ndim]])
23166  */
23167  __pyx_tuple__18 = PyTuple_Pack(1, __pyx_kp_s_Buffer_view_does_not_expose_stri); if (unlikely(!__pyx_tuple__18)) __PYX_ERR(2, 566, __pyx_L1_error)
23168  __Pyx_GOTREF(__pyx_tuple__18);
23169  __Pyx_GIVEREF(__pyx_tuple__18);
23170 
23171  /* "View.MemoryView":573
23172  * def suboffsets(self):
23173  * if self.view.suboffsets == NULL:
23174  * return (-1,) * self.view.ndim # <<<<<<<<<<<<<<
23175  *
23176  * return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]])
23177  */
23178  __pyx_tuple__19 = PyTuple_New(1); if (unlikely(!__pyx_tuple__19)) __PYX_ERR(2, 573, __pyx_L1_error)
23179  __Pyx_GOTREF(__pyx_tuple__19);
23180  __Pyx_INCREF(__pyx_int_neg_1);
23181  __Pyx_GIVEREF(__pyx_int_neg_1);
23182  PyTuple_SET_ITEM(__pyx_tuple__19, 0, __pyx_int_neg_1);
23183  __Pyx_GIVEREF(__pyx_tuple__19);
23184 
23185  /* "(tree fragment)":2
23186  * def __reduce_cython__(self):
23187  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
23188  * def __setstate_cython__(self, __pyx_state):
23189  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
23190  */
23191  __pyx_tuple__20 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__20)) __PYX_ERR(2, 2, __pyx_L1_error)
23192  __Pyx_GOTREF(__pyx_tuple__20);
23193  __Pyx_GIVEREF(__pyx_tuple__20);
23194 
23195  /* "(tree fragment)":4
23196  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
23197  * def __setstate_cython__(self, __pyx_state):
23198  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
23199  */
23200  __pyx_tuple__21 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__21)) __PYX_ERR(2, 4, __pyx_L1_error)
23201  __Pyx_GOTREF(__pyx_tuple__21);
23202  __Pyx_GIVEREF(__pyx_tuple__21);
23203 
23204  /* "View.MemoryView":678
23205  * if item is Ellipsis:
23206  * if not seen_ellipsis:
23207  * result.extend([slice(None)] * (ndim - len(tup) + 1)) # <<<<<<<<<<<<<<
23208  * seen_ellipsis = True
23209  * else:
23210  */
23211  __pyx_slice__22 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__22)) __PYX_ERR(2, 678, __pyx_L1_error)
23212  __Pyx_GOTREF(__pyx_slice__22);
23213  __Pyx_GIVEREF(__pyx_slice__22);
23214 
23215  /* "View.MemoryView":699
23216  * for suboffset in suboffsets[:ndim]:
23217  * if suboffset >= 0:
23218  * raise ValueError("Indirect dimensions not supported") # <<<<<<<<<<<<<<
23219  *
23220  *
23221  */
23222  __pyx_tuple__23 = PyTuple_Pack(1, __pyx_kp_s_Indirect_dimensions_not_supporte); if (unlikely(!__pyx_tuple__23)) __PYX_ERR(2, 699, __pyx_L1_error)
23223  __Pyx_GOTREF(__pyx_tuple__23);
23224  __Pyx_GIVEREF(__pyx_tuple__23);
23225 
23226  /* "(tree fragment)":2
23227  * def __reduce_cython__(self):
23228  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
23229  * def __setstate_cython__(self, __pyx_state):
23230  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
23231  */
23232  __pyx_tuple__24 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__24)) __PYX_ERR(2, 2, __pyx_L1_error)
23233  __Pyx_GOTREF(__pyx_tuple__24);
23234  __Pyx_GIVEREF(__pyx_tuple__24);
23235 
23236  /* "(tree fragment)":4
23237  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
23238  * def __setstate_cython__(self, __pyx_state):
23239  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
23240  */
23241  __pyx_tuple__25 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__25)) __PYX_ERR(2, 4, __pyx_L1_error)
23242  __Pyx_GOTREF(__pyx_tuple__25);
23243  __Pyx_GIVEREF(__pyx_tuple__25);
23244 
23245  /* "cpartitioning.pyx":19
23246  * buildDiscontinuousGalerkinSubdomain2GlobalMappings)
23247  *
23248  * def partitionElements(Comm comm, int nLayersOfOverlap, cmeshTools.CMesh cmesh, cmeshTools.CMesh subdomain_cmesh): # <<<<<<<<<<<<<<
23249  * cmesh.mesh.subdomainp = &subdomain_cmesh.mesh
23250  * c_partitionElements(comm.ob_mpi,
23251  */
23252  __pyx_tuple__31 = PyTuple_Pack(4, __pyx_n_s_comm, __pyx_n_s_nLayersOfOverlap, __pyx_n_s_cmesh, __pyx_n_s_subdomain_cmesh); if (unlikely(!__pyx_tuple__31)) __PYX_ERR(0, 19, __pyx_L1_error)
23253  __Pyx_GOTREF(__pyx_tuple__31);
23254  __Pyx_GIVEREF(__pyx_tuple__31);
23255  __pyx_codeobj__32 = (PyObject*)__Pyx_PyCode_New(4, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__31, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_cpartitioning_pyx, __pyx_n_s_partitionElements, 19, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__32)) __PYX_ERR(0, 19, __pyx_L1_error)
23256 
23257  /* "cpartitioning.pyx":35
23258  * )
23259  *
23260  * def partitionNodes(Comm comm, int nLayersOfOverlap, cmeshTools.CMesh cmesh, cmeshTools.CMesh subdomain_cmesh): # <<<<<<<<<<<<<<
23261  * cmesh.mesh.subdomainp = &subdomain_cmesh.mesh
23262  * c_partitionNodes(comm.ob_mpi,
23263  */
23264  __pyx_tuple__33 = PyTuple_Pack(4, __pyx_n_s_comm, __pyx_n_s_nLayersOfOverlap, __pyx_n_s_cmesh, __pyx_n_s_subdomain_cmesh); if (unlikely(!__pyx_tuple__33)) __PYX_ERR(0, 35, __pyx_L1_error)
23265  __Pyx_GOTREF(__pyx_tuple__33);
23266  __Pyx_GIVEREF(__pyx_tuple__33);
23267  __pyx_codeobj__34 = (PyObject*)__Pyx_PyCode_New(4, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__33, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_cpartitioning_pyx, __pyx_n_s_partitionNodes, 35, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__34)) __PYX_ERR(0, 35, __pyx_L1_error)
23268 
23269  /* "cpartitioning.pyx":51
23270  * )
23271  *
23272  * def convertPUMIPartitionToPython(Comm comm, cmeshTools.CMesh cmesh, cmeshTools.CMesh subdomain_cmesh): # <<<<<<<<<<<<<<
23273  * #need to have Python handles for the cmesh arrays created from apf/PUMI mesh
23274  * cmesh.mesh.subdomainp = &subdomain_cmesh.mesh
23275  */
23276  __pyx_tuple__35 = PyTuple_Pack(3, __pyx_n_s_comm, __pyx_n_s_cmesh, __pyx_n_s_subdomain_cmesh); if (unlikely(!__pyx_tuple__35)) __PYX_ERR(0, 51, __pyx_L1_error)
23277  __Pyx_GOTREF(__pyx_tuple__35);
23278  __Pyx_GIVEREF(__pyx_tuple__35);
23279  __pyx_codeobj__36 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__35, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_cpartitioning_pyx, __pyx_n_s_convertPUMIPartitionToPython, 51, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__36)) __PYX_ERR(0, 51, __pyx_L1_error)
23280 
23281  /* "cpartitioning.pyx":65
23282  * )
23283  *
23284  * def partitionNodesFromTetgenFiles(Comm comm, object filebase, int indexBase, int nLayersOfOverlap, cmeshTools.CMesh cmesh, cmeshTools.CMesh subdomain_cmesh): # <<<<<<<<<<<<<<
23285  * cmesh.mesh.subdomainp = &subdomain_cmesh.mesh
23286  * if not isinstance(filebase, bytes):
23287  */
23288  __pyx_tuple__37 = PyTuple_Pack(6, __pyx_n_s_comm, __pyx_n_s_filebase, __pyx_n_s_indexBase, __pyx_n_s_nLayersOfOverlap, __pyx_n_s_cmesh, __pyx_n_s_subdomain_cmesh); if (unlikely(!__pyx_tuple__37)) __PYX_ERR(0, 65, __pyx_L1_error)
23289  __Pyx_GOTREF(__pyx_tuple__37);
23290  __Pyx_GIVEREF(__pyx_tuple__37);
23291  __pyx_codeobj__38 = (PyObject*)__Pyx_PyCode_New(6, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__37, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_cpartitioning_pyx, __pyx_n_s_partitionNodesFromTetgenFiles, 65, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__38)) __PYX_ERR(0, 65, __pyx_L1_error)
23292 
23293  /* "cpartitioning.pyx":85
23294  * )
23295  *
23296  * def buildQuadraticLocal2GlobalMappings(Comm comm, # <<<<<<<<<<<<<<
23297  * int nSpace,
23298  * cmeshTools.CMesh cmesh,
23299  */
23300  __pyx_tuple__39 = PyTuple_Pack(19, __pyx_n_s_comm, __pyx_n_s_nSpace, __pyx_n_s_cmesh, __pyx_n_s_subdomain_cmesh, __pyx_n_s_elementOffsets_subdomain_owned, __pyx_n_s_nodeOffsets_subdomain_owned, __pyx_n_s_elementBoundaryOffsets_subdomain, __pyx_n_s_edgeOffsets_subdomain_owned, __pyx_n_s_elementNumbering_subdomain2globa, __pyx_n_s_nodeNumbering_subdomain2global, __pyx_n_s_elementBoundaryNumbering_subdoma, __pyx_n_s_edgeNumbering_subdomain2global, __pyx_n_s_quadratic_dof_offsets_subdomain, __pyx_n_s_quadratic_subdomain_l2g, __pyx_n_s_quadraticNumbering_subdomain2glo, __pyx_n_s_quadratic_lagrangeNodes, __pyx_n_s_nDOF_all_processes, __pyx_n_s_nDOF_subdomain, __pyx_n_s_max_dof_neighbors); if (unlikely(!__pyx_tuple__39)) __PYX_ERR(0, 85, __pyx_L1_error)
23301  __Pyx_GOTREF(__pyx_tuple__39);
23302  __Pyx_GIVEREF(__pyx_tuple__39);
23303  __pyx_codeobj__40 = (PyObject*)__Pyx_PyCode_New(16, 0, 19, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__39, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_cpartitioning_pyx, __pyx_n_s_buildQuadraticLocal2GlobalMappin, 85, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__40)) __PYX_ERR(0, 85, __pyx_L1_error)
23304 
23305  /* "cpartitioning.pyx":150
23306  * max_dof_neighbors)
23307  *
23308  * def buildQuadraticCubeLocal2GlobalMappings(Comm comm, # <<<<<<<<<<<<<<
23309  * int nSpace,
23310  * cmeshTools.CMesh cmesh,
23311  */
23312  __pyx_tuple__41 = PyTuple_Pack(19, __pyx_n_s_comm, __pyx_n_s_nSpace, __pyx_n_s_cmesh, __pyx_n_s_subdomain_cmesh, __pyx_n_s_elementOffsets_subdomain_owned, __pyx_n_s_nodeOffsets_subdomain_owned, __pyx_n_s_elementBoundaryOffsets_subdomain, __pyx_n_s_edgeOffsets_subdomain_owned, __pyx_n_s_elementNumbering_subdomain2globa, __pyx_n_s_nodeNumbering_subdomain2global, __pyx_n_s_elementBoundaryNumbering_subdoma, __pyx_n_s_edgeNumbering_subdomain2global, __pyx_n_s_quadratic_dof_offsets_subdomain, __pyx_n_s_quadratic_subdomain_l2g, __pyx_n_s_quadraticNumbering_subdomain2glo, __pyx_n_s_quadratic_lagrangeNodes, __pyx_n_s_nDOF_all_processes, __pyx_n_s_nDOF_subdomain, __pyx_n_s_max_dof_neighbors); if (unlikely(!__pyx_tuple__41)) __PYX_ERR(0, 150, __pyx_L1_error)
23313  __Pyx_GOTREF(__pyx_tuple__41);
23314  __Pyx_GIVEREF(__pyx_tuple__41);
23315  __pyx_codeobj__42 = (PyObject*)__Pyx_PyCode_New(16, 0, 19, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__41, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_cpartitioning_pyx, __pyx_n_s_buildQuadraticCubeLocal2GlobalMa, 150, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__42)) __PYX_ERR(0, 150, __pyx_L1_error)
23316 
23317  /* "cpartitioning.pyx":191
23318  * max_dof_neighbors)
23319  *
23320  * def buildDiscontinuousGalerkinLocal2GlobalMappings(Comm comm, # <<<<<<<<<<<<<<
23321  * int nDOF_element,
23322  * cmeshTools.CMesh cmesh,
23323  */
23324  __pyx_tuple__43 = PyTuple_Pack(12, __pyx_n_s_comm, __pyx_n_s_nDOF_element, __pyx_n_s_cmesh, __pyx_n_s_subdomain_cmesh, __pyx_n_s_elementOffsets_subdomain_owned, __pyx_n_s_elementNumbering_subdomain2globa, __pyx_n_s_dg_dof_offsets_subdomain_owned, __pyx_n_s_dg_subdomain_l2g, __pyx_n_s_dgNumbering_subdomain2global, __pyx_n_s_nDOF_all_processes, __pyx_n_s_nDOF_subdomain, __pyx_n_s_max_dof_neighbors); if (unlikely(!__pyx_tuple__43)) __PYX_ERR(0, 191, __pyx_L1_error)
23325  __Pyx_GOTREF(__pyx_tuple__43);
23326  __Pyx_GIVEREF(__pyx_tuple__43);
23327  __pyx_codeobj__44 = (PyObject*)__Pyx_PyCode_New(9, 0, 12, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__43, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_cpartitioning_pyx, __pyx_n_s_buildDiscontinuousGalerkinLocal2, 191, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__44)) __PYX_ERR(0, 191, __pyx_L1_error)
23328 
23329  /* "View.MemoryView":286
23330  * return self.name
23331  *
23332  * cdef generic = Enum("<strided and direct or indirect>") # <<<<<<<<<<<<<<
23333  * cdef strided = Enum("<strided and direct>") # default
23334  * cdef indirect = Enum("<strided and indirect>")
23335  */
23336  __pyx_tuple__45 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct_or_indirect); if (unlikely(!__pyx_tuple__45)) __PYX_ERR(2, 286, __pyx_L1_error)
23337  __Pyx_GOTREF(__pyx_tuple__45);
23338  __Pyx_GIVEREF(__pyx_tuple__45);
23339 
23340  /* "View.MemoryView":287
23341  *
23342  * cdef generic = Enum("<strided and direct or indirect>")
23343  * cdef strided = Enum("<strided and direct>") # default # <<<<<<<<<<<<<<
23344  * cdef indirect = Enum("<strided and indirect>")
23345  *
23346  */
23347  __pyx_tuple__46 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct); if (unlikely(!__pyx_tuple__46)) __PYX_ERR(2, 287, __pyx_L1_error)
23348  __Pyx_GOTREF(__pyx_tuple__46);
23349  __Pyx_GIVEREF(__pyx_tuple__46);
23350 
23351  /* "View.MemoryView":288
23352  * cdef generic = Enum("<strided and direct or indirect>")
23353  * cdef strided = Enum("<strided and direct>") # default
23354  * cdef indirect = Enum("<strided and indirect>") # <<<<<<<<<<<<<<
23355  *
23356  *
23357  */
23358  __pyx_tuple__47 = PyTuple_Pack(1, __pyx_kp_s_strided_and_indirect); if (unlikely(!__pyx_tuple__47)) __PYX_ERR(2, 288, __pyx_L1_error)
23359  __Pyx_GOTREF(__pyx_tuple__47);
23360  __Pyx_GIVEREF(__pyx_tuple__47);
23361 
23362  /* "View.MemoryView":291
23363  *
23364  *
23365  * cdef contiguous = Enum("<contiguous and direct>") # <<<<<<<<<<<<<<
23366  * cdef indirect_contiguous = Enum("<contiguous and indirect>")
23367  *
23368  */
23369  __pyx_tuple__48 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_direct); if (unlikely(!__pyx_tuple__48)) __PYX_ERR(2, 291, __pyx_L1_error)
23370  __Pyx_GOTREF(__pyx_tuple__48);
23371  __Pyx_GIVEREF(__pyx_tuple__48);
23372 
23373  /* "View.MemoryView":292
23374  *
23375  * cdef contiguous = Enum("<contiguous and direct>")
23376  * cdef indirect_contiguous = Enum("<contiguous and indirect>") # <<<<<<<<<<<<<<
23377  *
23378  *
23379  */
23380  __pyx_tuple__49 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_indirect); if (unlikely(!__pyx_tuple__49)) __PYX_ERR(2, 292, __pyx_L1_error)
23381  __Pyx_GOTREF(__pyx_tuple__49);
23382  __Pyx_GIVEREF(__pyx_tuple__49);
23383 
23384  /* "(tree fragment)":1
23385  * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<<
23386  * cdef object __pyx_PickleError
23387  * cdef object __pyx_result
23388  */
23389  __pyx_tuple__50 = PyTuple_Pack(5, __pyx_n_s_pyx_type, __pyx_n_s_pyx_checksum, __pyx_n_s_pyx_state, __pyx_n_s_pyx_PickleError, __pyx_n_s_pyx_result); if (unlikely(!__pyx_tuple__50)) __PYX_ERR(2, 1, __pyx_L1_error)
23390  __Pyx_GOTREF(__pyx_tuple__50);
23391  __Pyx_GIVEREF(__pyx_tuple__50);
23392  __pyx_codeobj__51 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__50, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_Enum, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__51)) __PYX_ERR(2, 1, __pyx_L1_error)
23393  __Pyx_RefNannyFinishContext();
23394  return 0;
23395  __pyx_L1_error:;
23396  __Pyx_RefNannyFinishContext();
23397  return -1;
23398 }
23399 
23400 static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void) {
23401  if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
23402  __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) __PYX_ERR(0, 1, __pyx_L1_error)
23403  __pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) __PYX_ERR(0, 1, __pyx_L1_error)
23404  __pyx_int_184977713 = PyInt_FromLong(184977713L); if (unlikely(!__pyx_int_184977713)) __PYX_ERR(0, 1, __pyx_L1_error)
23405  __pyx_int_neg_1 = PyInt_FromLong(-1); if (unlikely(!__pyx_int_neg_1)) __PYX_ERR(0, 1, __pyx_L1_error)
23406  return 0;
23407  __pyx_L1_error:;
23408  return -1;
23409 }
23410 
23411 static CYTHON_SMALL_CODE int __Pyx_modinit_global_init_code(void); /*proto*/
23412 static CYTHON_SMALL_CODE int __Pyx_modinit_variable_export_code(void); /*proto*/
23413 static CYTHON_SMALL_CODE int __Pyx_modinit_function_export_code(void); /*proto*/
23414 static CYTHON_SMALL_CODE int __Pyx_modinit_type_init_code(void); /*proto*/
23415 static CYTHON_SMALL_CODE int __Pyx_modinit_type_import_code(void); /*proto*/
23416 static CYTHON_SMALL_CODE int __Pyx_modinit_variable_import_code(void); /*proto*/
23417 static CYTHON_SMALL_CODE int __Pyx_modinit_function_import_code(void); /*proto*/
23418 
23419 static int __Pyx_modinit_global_init_code(void) {
23420  __Pyx_RefNannyDeclarations
23421  __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0);
23422  /*--- Global init code ---*/
23423  generic = Py_None; Py_INCREF(Py_None);
23424  strided = Py_None; Py_INCREF(Py_None);
23425  indirect = Py_None; Py_INCREF(Py_None);
23426  contiguous = Py_None; Py_INCREF(Py_None);
23427  indirect_contiguous = Py_None; Py_INCREF(Py_None);
23428  __Pyx_RefNannyFinishContext();
23429  return 0;
23430 }
23431 
23432 static int __Pyx_modinit_variable_export_code(void) {
23433  __Pyx_RefNannyDeclarations
23434  __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0);
23435  /*--- Variable export code ---*/
23436  __Pyx_RefNannyFinishContext();
23437  return 0;
23438 }
23439 
23440 static int __Pyx_modinit_function_export_code(void) {
23441  __Pyx_RefNannyDeclarations
23442  __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0);
23443  /*--- Function export code ---*/
23444  __Pyx_RefNannyFinishContext();
23445  return 0;
23446 }
23447 
23448 static int __Pyx_modinit_type_init_code(void) {
23449  __Pyx_RefNannyDeclarations
23450  __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0);
23451  /*--- Type init code ---*/
23452  __pyx_vtabptr_array = &__pyx_vtable_array;
23453  __pyx_vtable_array.get_memview = (PyObject *(*)(struct __pyx_array_obj *))__pyx_array_get_memview;
23454  if (PyType_Ready(&__pyx_type___pyx_array) < 0) __PYX_ERR(2, 105, __pyx_L1_error)
23455  __pyx_type___pyx_array.tp_print = 0;
23456  if (__Pyx_SetVtable(__pyx_type___pyx_array.tp_dict, __pyx_vtabptr_array) < 0) __PYX_ERR(2, 105, __pyx_L1_error)
23457  if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_array) < 0) __PYX_ERR(2, 105, __pyx_L1_error)
23458  __pyx_array_type = &__pyx_type___pyx_array;
23459  if (PyType_Ready(&__pyx_type___pyx_MemviewEnum) < 0) __PYX_ERR(2, 279, __pyx_L1_error)
23460  __pyx_type___pyx_MemviewEnum.tp_print = 0;
23461  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type___pyx_MemviewEnum.tp_dictoffset && __pyx_type___pyx_MemviewEnum.tp_getattro == PyObject_GenericGetAttr)) {
23462  __pyx_type___pyx_MemviewEnum.tp_getattro = __Pyx_PyObject_GenericGetAttr;
23463  }
23464  if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_MemviewEnum) < 0) __PYX_ERR(2, 279, __pyx_L1_error)
23465  __pyx_MemviewEnum_type = &__pyx_type___pyx_MemviewEnum;
23466  __pyx_vtabptr_memoryview = &__pyx_vtable_memoryview;
23467  __pyx_vtable_memoryview.get_item_pointer = (char *(*)(struct __pyx_memoryview_obj *, PyObject *))__pyx_memoryview_get_item_pointer;
23468  __pyx_vtable_memoryview.is_slice = (PyObject *(*)(struct __pyx_memoryview_obj *, PyObject *))__pyx_memoryview_is_slice;
23469  __pyx_vtable_memoryview.setitem_slice_assignment = (PyObject *(*)(struct __pyx_memoryview_obj *, PyObject *, PyObject *))__pyx_memoryview_setitem_slice_assignment;
23470  __pyx_vtable_memoryview.setitem_slice_assign_scalar = (PyObject *(*)(struct __pyx_memoryview_obj *, struct __pyx_memoryview_obj *, PyObject *))__pyx_memoryview_setitem_slice_assign_scalar;
23471  __pyx_vtable_memoryview.setitem_indexed = (PyObject *(*)(struct __pyx_memoryview_obj *, PyObject *, PyObject *))__pyx_memoryview_setitem_indexed;
23472  __pyx_vtable_memoryview.convert_item_to_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *))__pyx_memoryview_convert_item_to_object;
23473  __pyx_vtable_memoryview.assign_item_from_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *, PyObject *))__pyx_memoryview_assign_item_from_object;
23474  if (PyType_Ready(&__pyx_type___pyx_memoryview) < 0) __PYX_ERR(2, 330, __pyx_L1_error)
23475  __pyx_type___pyx_memoryview.tp_print = 0;
23476  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type___pyx_memoryview.tp_dictoffset && __pyx_type___pyx_memoryview.tp_getattro == PyObject_GenericGetAttr)) {
23477  __pyx_type___pyx_memoryview.tp_getattro = __Pyx_PyObject_GenericGetAttr;
23478  }
23479  if (__Pyx_SetVtable(__pyx_type___pyx_memoryview.tp_dict, __pyx_vtabptr_memoryview) < 0) __PYX_ERR(2, 330, __pyx_L1_error)
23480  if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_memoryview) < 0) __PYX_ERR(2, 330, __pyx_L1_error)
23481  __pyx_memoryview_type = &__pyx_type___pyx_memoryview;
23482  __pyx_vtabptr__memoryviewslice = &__pyx_vtable__memoryviewslice;
23483  __pyx_vtable__memoryviewslice.__pyx_base = *__pyx_vtabptr_memoryview;
23484  __pyx_vtable__memoryviewslice.__pyx_base.convert_item_to_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *))__pyx_memoryviewslice_convert_item_to_object;
23485  __pyx_vtable__memoryviewslice.__pyx_base.assign_item_from_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *, PyObject *))__pyx_memoryviewslice_assign_item_from_object;
23486  __pyx_type___pyx_memoryviewslice.tp_base = __pyx_memoryview_type;
23487  if (PyType_Ready(&__pyx_type___pyx_memoryviewslice) < 0) __PYX_ERR(2, 961, __pyx_L1_error)
23488  __pyx_type___pyx_memoryviewslice.tp_print = 0;
23489  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type___pyx_memoryviewslice.tp_dictoffset && __pyx_type___pyx_memoryviewslice.tp_getattro == PyObject_GenericGetAttr)) {
23490  __pyx_type___pyx_memoryviewslice.tp_getattro = __Pyx_PyObject_GenericGetAttr;
23491  }
23492  if (__Pyx_SetVtable(__pyx_type___pyx_memoryviewslice.tp_dict, __pyx_vtabptr__memoryviewslice) < 0) __PYX_ERR(2, 961, __pyx_L1_error)
23493  if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_memoryviewslice) < 0) __PYX_ERR(2, 961, __pyx_L1_error)
23494  __pyx_memoryviewslice_type = &__pyx_type___pyx_memoryviewslice;
23495  __Pyx_RefNannyFinishContext();
23496  return 0;
23497  __pyx_L1_error:;
23498  __Pyx_RefNannyFinishContext();
23499  return -1;
23500 }
23501 
23502 static int __Pyx_modinit_type_import_code(void) {
23503  __Pyx_RefNannyDeclarations
23504  PyObject *__pyx_t_1 = NULL;
23505  __Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0);
23506  /*--- Type import code ---*/
23507  __pyx_t_1 = PyImport_ImportModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 9, __pyx_L1_error)
23508  __Pyx_GOTREF(__pyx_t_1);
23509  __pyx_ptype_7cpython_4type_type = __Pyx_ImportType(__pyx_t_1, __Pyx_BUILTIN_MODULE_NAME, "type",
23510  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
23511  sizeof(PyTypeObject),
23512  #else
23513  sizeof(PyHeapTypeObject),
23514  #endif
23515  __Pyx_ImportType_CheckSize_Warn);
23516  if (!__pyx_ptype_7cpython_4type_type) __PYX_ERR(3, 9, __pyx_L1_error)
23517  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23518  __pyx_t_1 = PyImport_ImportModule("numpy"); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 206, __pyx_L1_error)
23519  __Pyx_GOTREF(__pyx_t_1);
23520  __pyx_ptype_5numpy_dtype = __Pyx_ImportType(__pyx_t_1, "numpy", "dtype", sizeof(PyArray_Descr), __Pyx_ImportType_CheckSize_Ignore);
23521  if (!__pyx_ptype_5numpy_dtype) __PYX_ERR(1, 206, __pyx_L1_error)
23522  __pyx_ptype_5numpy_flatiter = __Pyx_ImportType(__pyx_t_1, "numpy", "flatiter", sizeof(PyArrayIterObject), __Pyx_ImportType_CheckSize_Warn);
23523  if (!__pyx_ptype_5numpy_flatiter) __PYX_ERR(1, 229, __pyx_L1_error)
23524  __pyx_ptype_5numpy_broadcast = __Pyx_ImportType(__pyx_t_1, "numpy", "broadcast", sizeof(PyArrayMultiIterObject), __Pyx_ImportType_CheckSize_Warn);
23525  if (!__pyx_ptype_5numpy_broadcast) __PYX_ERR(1, 233, __pyx_L1_error)
23526  __pyx_ptype_5numpy_ndarray = __Pyx_ImportType(__pyx_t_1, "numpy", "ndarray", sizeof(PyArrayObject), __Pyx_ImportType_CheckSize_Ignore);
23527  if (!__pyx_ptype_5numpy_ndarray) __PYX_ERR(1, 242, __pyx_L1_error)
23528  __pyx_ptype_5numpy_ufunc = __Pyx_ImportType(__pyx_t_1, "numpy", "ufunc", sizeof(PyUFuncObject), __Pyx_ImportType_CheckSize_Warn);
23529  if (!__pyx_ptype_5numpy_ufunc) __PYX_ERR(1, 918, __pyx_L1_error)
23530  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23531  __pyx_t_1 = PyImport_ImportModule("mpi4py.MPI"); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 28, __pyx_L1_error)
23532  __Pyx_GOTREF(__pyx_t_1);
23533  __pyx_ptype_6mpi4py_3MPI_Status = __Pyx_ImportType(__pyx_t_1, "mpi4py.MPI", "Status", sizeof(struct PyMPIStatusObject), __Pyx_ImportType_CheckSize_Warn);
23534  if (!__pyx_ptype_6mpi4py_3MPI_Status) __PYX_ERR(4, 28, __pyx_L1_error)
23535  __pyx_ptype_6mpi4py_3MPI_Datatype = __Pyx_ImportType(__pyx_t_1, "mpi4py.MPI", "Datatype", sizeof(struct PyMPIDatatypeObject), __Pyx_ImportType_CheckSize_Warn);
23536  if (!__pyx_ptype_6mpi4py_3MPI_Datatype) __PYX_ERR(4, 35, __pyx_L1_error)
23537  __pyx_ptype_6mpi4py_3MPI_Request = __Pyx_ImportType(__pyx_t_1, "mpi4py.MPI", "Request", sizeof(struct PyMPIRequestObject), __Pyx_ImportType_CheckSize_Warn);
23538  if (!__pyx_ptype_6mpi4py_3MPI_Request) __PYX_ERR(4, 42, __pyx_L1_error)
23539  __pyx_ptype_6mpi4py_3MPI_Prequest = __Pyx_ImportType(__pyx_t_1, "mpi4py.MPI", "Prequest", sizeof(struct PyMPIPrequestObject), __Pyx_ImportType_CheckSize_Warn);
23540  if (!__pyx_ptype_6mpi4py_3MPI_Prequest) __PYX_ERR(4, 50, __pyx_L1_error)
23541  __pyx_ptype_6mpi4py_3MPI_Grequest = __Pyx_ImportType(__pyx_t_1, "mpi4py.MPI", "Grequest", sizeof(struct PyMPIGrequestObject), __Pyx_ImportType_CheckSize_Warn);
23542  if (!__pyx_ptype_6mpi4py_3MPI_Grequest) __PYX_ERR(4, 56, __pyx_L1_error)
23543  __pyx_ptype_6mpi4py_3MPI_Message = __Pyx_ImportType(__pyx_t_1, "mpi4py.MPI", "Message", sizeof(struct PyMPIMessageObject), __Pyx_ImportType_CheckSize_Warn);
23544  if (!__pyx_ptype_6mpi4py_3MPI_Message) __PYX_ERR(4, 62, __pyx_L1_error)
23545  __pyx_ptype_6mpi4py_3MPI_Op = __Pyx_ImportType(__pyx_t_1, "mpi4py.MPI", "Op", sizeof(struct PyMPIOpObject), __Pyx_ImportType_CheckSize_Warn);
23546  if (!__pyx_ptype_6mpi4py_3MPI_Op) __PYX_ERR(4, 70, __pyx_L1_error)
23547  __pyx_ptype_6mpi4py_3MPI_Group = __Pyx_ImportType(__pyx_t_1, "mpi4py.MPI", "Group", sizeof(struct PyMPIGroupObject), __Pyx_ImportType_CheckSize_Warn);
23548  if (!__pyx_ptype_6mpi4py_3MPI_Group) __PYX_ERR(4, 79, __pyx_L1_error)
23549  __pyx_ptype_6mpi4py_3MPI_Info = __Pyx_ImportType(__pyx_t_1, "mpi4py.MPI", "Info", sizeof(struct PyMPIInfoObject), __Pyx_ImportType_CheckSize_Warn);
23550  if (!__pyx_ptype_6mpi4py_3MPI_Info) __PYX_ERR(4, 86, __pyx_L1_error)
23551  __pyx_ptype_6mpi4py_3MPI_Errhandler = __Pyx_ImportType(__pyx_t_1, "mpi4py.MPI", "Errhandler", sizeof(struct PyMPIErrhandlerObject), __Pyx_ImportType_CheckSize_Warn);
23552  if (!__pyx_ptype_6mpi4py_3MPI_Errhandler) __PYX_ERR(4, 93, __pyx_L1_error)
23553  __pyx_ptype_6mpi4py_3MPI_Comm = __Pyx_ImportType(__pyx_t_1, "mpi4py.MPI", "Comm", sizeof(struct PyMPICommObject), __Pyx_ImportType_CheckSize_Warn);
23554  if (!__pyx_ptype_6mpi4py_3MPI_Comm) __PYX_ERR(4, 100, __pyx_L1_error)
23555  __pyx_ptype_6mpi4py_3MPI_Intracomm = __Pyx_ImportType(__pyx_t_1, "mpi4py.MPI", "Intracomm", sizeof(struct PyMPIIntracommObject), __Pyx_ImportType_CheckSize_Warn);
23556  if (!__pyx_ptype_6mpi4py_3MPI_Intracomm) __PYX_ERR(4, 107, __pyx_L1_error)
23557  __pyx_ptype_6mpi4py_3MPI_Topocomm = __Pyx_ImportType(__pyx_t_1, "mpi4py.MPI", "Topocomm", sizeof(struct PyMPITopocommObject), __Pyx_ImportType_CheckSize_Warn);
23558  if (!__pyx_ptype_6mpi4py_3MPI_Topocomm) __PYX_ERR(4, 113, __pyx_L1_error)
23559  __pyx_ptype_6mpi4py_3MPI_Cartcomm = __Pyx_ImportType(__pyx_t_1, "mpi4py.MPI", "Cartcomm", sizeof(struct PyMPICartcommObject), __Pyx_ImportType_CheckSize_Warn);
23560  if (!__pyx_ptype_6mpi4py_3MPI_Cartcomm) __PYX_ERR(4, 119, __pyx_L1_error)
23561  __pyx_ptype_6mpi4py_3MPI_Graphcomm = __Pyx_ImportType(__pyx_t_1, "mpi4py.MPI", "Graphcomm", sizeof(struct PyMPIGraphcommObject), __Pyx_ImportType_CheckSize_Warn);
23562  if (!__pyx_ptype_6mpi4py_3MPI_Graphcomm) __PYX_ERR(4, 125, __pyx_L1_error)
23563  __pyx_ptype_6mpi4py_3MPI_Distgraphcomm = __Pyx_ImportType(__pyx_t_1, "mpi4py.MPI", "Distgraphcomm", sizeof(struct PyMPIDistgraphcommObject), __Pyx_ImportType_CheckSize_Warn);
23564  if (!__pyx_ptype_6mpi4py_3MPI_Distgraphcomm) __PYX_ERR(4, 131, __pyx_L1_error)
23565  __pyx_ptype_6mpi4py_3MPI_Intercomm = __Pyx_ImportType(__pyx_t_1, "mpi4py.MPI", "Intercomm", sizeof(struct PyMPIIntercommObject), __Pyx_ImportType_CheckSize_Warn);
23566  if (!__pyx_ptype_6mpi4py_3MPI_Intercomm) __PYX_ERR(4, 137, __pyx_L1_error)
23567  __pyx_ptype_6mpi4py_3MPI_Win = __Pyx_ImportType(__pyx_t_1, "mpi4py.MPI", "Win", sizeof(struct PyMPIWinObject), __Pyx_ImportType_CheckSize_Warn);
23568  if (!__pyx_ptype_6mpi4py_3MPI_Win) __PYX_ERR(4, 143, __pyx_L1_error)
23569  __pyx_ptype_6mpi4py_3MPI_File = __Pyx_ImportType(__pyx_t_1, "mpi4py.MPI", "File", sizeof(struct PyMPIFileObject), __Pyx_ImportType_CheckSize_Warn);
23570  if (!__pyx_ptype_6mpi4py_3MPI_File) __PYX_ERR(4, 151, __pyx_L1_error)
23571  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23572  __pyx_t_1 = PyImport_ImportModule("proteus.cmeshTools"); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 5, __pyx_L1_error)
23573  __Pyx_GOTREF(__pyx_t_1);
23574  __pyx_ptype_7proteus_10cmeshTools_CMesh = __Pyx_ImportType(__pyx_t_1, "proteus.cmeshTools", "CMesh", sizeof(struct __pyx_obj_7proteus_10cmeshTools_CMesh), __Pyx_ImportType_CheckSize_Warn);
23575  if (!__pyx_ptype_7proteus_10cmeshTools_CMesh) __PYX_ERR(5, 5, __pyx_L1_error)
23576  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23577  __Pyx_RefNannyFinishContext();
23578  return 0;
23579  __pyx_L1_error:;
23580  __Pyx_XDECREF(__pyx_t_1);
23581  __Pyx_RefNannyFinishContext();
23582  return -1;
23583 }
23584 
23585 static int __Pyx_modinit_variable_import_code(void) {
23586  __Pyx_RefNannyDeclarations
23587  __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0);
23588  /*--- Variable import code ---*/
23589  __Pyx_RefNannyFinishContext();
23590  return 0;
23591 }
23592 
23593 static int __Pyx_modinit_function_import_code(void) {
23594  __Pyx_RefNannyDeclarations
23595  __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0);
23596  /*--- Function import code ---*/
23597  __Pyx_RefNannyFinishContext();
23598  return 0;
23599 }
23600 
23601 
23602 #if PY_MAJOR_VERSION < 3
23603 #ifdef CYTHON_NO_PYINIT_EXPORT
23604 #define __Pyx_PyMODINIT_FUNC void
23605 #else
23606 #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC
23607 #endif
23608 #else
23609 #ifdef CYTHON_NO_PYINIT_EXPORT
23610 #define __Pyx_PyMODINIT_FUNC PyObject *
23611 #else
23612 #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC
23613 #endif
23614 #endif
23615 
23616 
23617 #if PY_MAJOR_VERSION < 3
23618 __Pyx_PyMODINIT_FUNC initcpartitioning(void) CYTHON_SMALL_CODE; /*proto*/
23619 __Pyx_PyMODINIT_FUNC initcpartitioning(void)
23620 #else
23621 __Pyx_PyMODINIT_FUNC PyInit_cpartitioning(void) CYTHON_SMALL_CODE; /*proto*/
23622 __Pyx_PyMODINIT_FUNC PyInit_cpartitioning(void)
23623 #if CYTHON_PEP489_MULTI_PHASE_INIT
23624 {
23625  return PyModuleDef_Init(&__pyx_moduledef);
23626 }
23627 static CYTHON_SMALL_CODE int __Pyx_check_single_interpreter(void) {
23628  #if PY_VERSION_HEX >= 0x030700A1
23629  static PY_INT64_T main_interpreter_id = -1;
23630  PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp);
23631  if (main_interpreter_id == -1) {
23632  main_interpreter_id = current_id;
23633  return (unlikely(current_id == -1)) ? -1 : 0;
23634  } else if (unlikely(main_interpreter_id != current_id))
23635  #else
23636  static PyInterpreterState *main_interpreter = NULL;
23637  PyInterpreterState *current_interpreter = PyThreadState_Get()->interp;
23638  if (!main_interpreter) {
23639  main_interpreter = current_interpreter;
23640  } else if (unlikely(main_interpreter != current_interpreter))
23641  #endif
23642  {
23643  PyErr_SetString(
23644  PyExc_ImportError,
23645  "Interpreter change detected - this module can only be loaded into one interpreter per process.");
23646  return -1;
23647  }
23648  return 0;
23649 }
23650 static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *moddict, const char* from_name, const char* to_name, int allow_none) {
23651  PyObject *value = PyObject_GetAttrString(spec, from_name);
23652  int result = 0;
23653  if (likely(value)) {
23654  if (allow_none || value != Py_None) {
23655  result = PyDict_SetItemString(moddict, to_name, value);
23656  }
23657  Py_DECREF(value);
23658  } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) {
23659  PyErr_Clear();
23660  } else {
23661  result = -1;
23662  }
23663  return result;
23664 }
23665 static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, CYTHON_UNUSED PyModuleDef *def) {
23666  PyObject *module = NULL, *moddict, *modname;
23667  if (__Pyx_check_single_interpreter())
23668  return NULL;
23669  if (__pyx_m)
23670  return __Pyx_NewRef(__pyx_m);
23671  modname = PyObject_GetAttrString(spec, "name");
23672  if (unlikely(!modname)) goto bad;
23673  module = PyModule_NewObject(modname);
23674  Py_DECREF(modname);
23675  if (unlikely(!module)) goto bad;
23676  moddict = PyModule_GetDict(module);
23677  if (unlikely(!moddict)) goto bad;
23678  if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__", 1) < 0)) goto bad;
23679  if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__", 1) < 0)) goto bad;
23680  if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__", 1) < 0)) goto bad;
23681  if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__", 0) < 0)) goto bad;
23682  return module;
23683 bad:
23684  Py_XDECREF(module);
23685  return NULL;
23686 }
23687 
23688 
23689 static CYTHON_SMALL_CODE int __pyx_pymod_exec_cpartitioning(PyObject *__pyx_pyinit_module)
23690 #endif
23691 #endif
23692 {
23693  PyObject *__pyx_t_1 = NULL;
23694  PyObject *__pyx_t_2 = NULL;
23695  static PyThread_type_lock __pyx_t_3[8];
23696  __Pyx_RefNannyDeclarations
23697  #if CYTHON_PEP489_MULTI_PHASE_INIT
23698  if (__pyx_m) {
23699  if (__pyx_m == __pyx_pyinit_module) return 0;
23700  PyErr_SetString(PyExc_RuntimeError, "Module 'cpartitioning' has already been imported. Re-initialisation is not supported.");
23701  return -1;
23702  }
23703  #elif PY_MAJOR_VERSION >= 3
23704  if (__pyx_m) return __Pyx_NewRef(__pyx_m);
23705  #endif
23706  #if CYTHON_REFNANNY
23707 __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny");
23708 if (!__Pyx_RefNanny) {
23709  PyErr_Clear();
23710  __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny");
23711  if (!__Pyx_RefNanny)
23712  Py_FatalError("failed to import 'refnanny' module");
23713 }
23714 #endif
23715  __Pyx_RefNannySetupContext("__Pyx_PyMODINIT_FUNC PyInit_cpartitioning(void)", 0);
23716  if (__Pyx_check_binary_version() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23717  #ifdef __Pxy_PyFrame_Initialize_Offsets
23718  __Pxy_PyFrame_Initialize_Offsets();
23719  #endif
23720  __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error)
23721  __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error)
23722  __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error)
23723  #ifdef __Pyx_CyFunction_USED
23724  if (__pyx_CyFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23725  #endif
23726  #ifdef __Pyx_FusedFunction_USED
23727  if (__pyx_FusedFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23728  #endif
23729  #ifdef __Pyx_Coroutine_USED
23730  if (__pyx_Coroutine_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23731  #endif
23732  #ifdef __Pyx_Generator_USED
23733  if (__pyx_Generator_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23734  #endif
23735  #ifdef __Pyx_AsyncGen_USED
23736  if (__pyx_AsyncGen_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23737  #endif
23738  #ifdef __Pyx_StopAsyncIteration_USED
23739  if (__pyx_StopAsyncIteration_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23740  #endif
23741  /*--- Library function declarations ---*/
23742  /*--- Threads initialization code ---*/
23743  #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS
23744  #ifdef WITH_THREAD /* Python build with threading support? */
23745  PyEval_InitThreads();
23746  #endif
23747  #endif
23748  /*--- Module creation code ---*/
23749  #if CYTHON_PEP489_MULTI_PHASE_INIT
23750  __pyx_m = __pyx_pyinit_module;
23751  Py_INCREF(__pyx_m);
23752  #else
23753  #if PY_MAJOR_VERSION < 3
23754  __pyx_m = Py_InitModule4("cpartitioning", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m);
23755  #else
23756  __pyx_m = PyModule_Create(&__pyx_moduledef);
23757  #endif
23758  if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error)
23759  #endif
23760  __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error)
23761  Py_INCREF(__pyx_d);
23762  __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error)
23763  __pyx_cython_runtime = PyImport_AddModule((char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error)
23764  #if CYTHON_COMPILING_IN_PYPY
23765  Py_INCREF(__pyx_b);
23766  #endif
23767  if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
23768  /*--- Initialize various global constants etc. ---*/
23769  if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23770  #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT)
23771  if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23772  #endif
23773  if (__pyx_module_is_main_cpartitioning) {
23774  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_name_2, __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23775  }
23776  #if PY_MAJOR_VERSION >= 3
23777  {
23778  PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error)
23779  if (!PyDict_GetItemString(modules, "cpartitioning")) {
23780  if (unlikely(PyDict_SetItemString(modules, "cpartitioning", __pyx_m) < 0)) __PYX_ERR(0, 1, __pyx_L1_error)
23781  }
23782  }
23783  #endif
23784  /*--- Builtin init code ---*/
23785  if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23786  /*--- Constants init code ---*/
23787  if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23788  /*--- Global type/function init code ---*/
23789  (void)__Pyx_modinit_global_init_code();
23790  (void)__Pyx_modinit_variable_export_code();
23791  (void)__Pyx_modinit_function_export_code();
23792  if (unlikely(__Pyx_modinit_type_init_code() != 0)) goto __pyx_L1_error;
23793  if (unlikely(__Pyx_modinit_type_import_code() != 0)) goto __pyx_L1_error;
23794  (void)__Pyx_modinit_variable_import_code();
23795  (void)__Pyx_modinit_function_import_code();
23796  /*--- Execution code ---*/
23797  #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
23798  if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23799  #endif
23800 
23801  /* "cpartitioning.pyx":2
23802  * # A type of -*- python -*- file
23803  * from proteus import Comm as proteus_Comm # <<<<<<<<<<<<<<
23804  * import numpy as np
23805  * cimport numpy as np
23806  */
23807  __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2, __pyx_L1_error)
23808  __Pyx_GOTREF(__pyx_t_1);
23809  __Pyx_INCREF(__pyx_n_s_Comm);
23810  __Pyx_GIVEREF(__pyx_n_s_Comm);
23811  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_Comm);
23812  __pyx_t_2 = __Pyx_Import(__pyx_n_s_proteus, __pyx_t_1, -1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2, __pyx_L1_error)
23813  __Pyx_GOTREF(__pyx_t_2);
23814  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23815  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_Comm); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2, __pyx_L1_error)
23816  __Pyx_GOTREF(__pyx_t_1);
23817  if (PyDict_SetItem(__pyx_d, __pyx_n_s_proteus_Comm, __pyx_t_1) < 0) __PYX_ERR(0, 2, __pyx_L1_error)
23818  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23819  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
23820 
23821  /* "cpartitioning.pyx":3
23822  * # A type of -*- python -*- file
23823  * from proteus import Comm as proteus_Comm
23824  * import numpy as np # <<<<<<<<<<<<<<
23825  * cimport numpy as np
23826  * from mpi4py.MPI cimport (Comm,
23827  */
23828  __pyx_t_2 = __Pyx_Import(__pyx_n_s_numpy, 0, -1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3, __pyx_L1_error)
23829  __Pyx_GOTREF(__pyx_t_2);
23830  if (PyDict_SetItem(__pyx_d, __pyx_n_s_np, __pyx_t_2) < 0) __PYX_ERR(0, 3, __pyx_L1_error)
23831  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
23832 
23833  /* "cpartitioning.pyx":19
23834  * buildDiscontinuousGalerkinSubdomain2GlobalMappings)
23835  *
23836  * def partitionElements(Comm comm, int nLayersOfOverlap, cmeshTools.CMesh cmesh, cmeshTools.CMesh subdomain_cmesh): # <<<<<<<<<<<<<<
23837  * cmesh.mesh.subdomainp = &subdomain_cmesh.mesh
23838  * c_partitionElements(comm.ob_mpi,
23839  */
23840  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_13cpartitioning_1partitionElements, NULL, __pyx_n_s_cpartitioning); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 19, __pyx_L1_error)
23841  __Pyx_GOTREF(__pyx_t_2);
23842  if (PyDict_SetItem(__pyx_d, __pyx_n_s_partitionElements, __pyx_t_2) < 0) __PYX_ERR(0, 19, __pyx_L1_error)
23843  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
23844 
23845  /* "cpartitioning.pyx":35
23846  * )
23847  *
23848  * def partitionNodes(Comm comm, int nLayersOfOverlap, cmeshTools.CMesh cmesh, cmeshTools.CMesh subdomain_cmesh): # <<<<<<<<<<<<<<
23849  * cmesh.mesh.subdomainp = &subdomain_cmesh.mesh
23850  * c_partitionNodes(comm.ob_mpi,
23851  */
23852  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_13cpartitioning_3partitionNodes, NULL, __pyx_n_s_cpartitioning); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 35, __pyx_L1_error)
23853  __Pyx_GOTREF(__pyx_t_2);
23854  if (PyDict_SetItem(__pyx_d, __pyx_n_s_partitionNodes, __pyx_t_2) < 0) __PYX_ERR(0, 35, __pyx_L1_error)
23855  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
23856 
23857  /* "cpartitioning.pyx":51
23858  * )
23859  *
23860  * def convertPUMIPartitionToPython(Comm comm, cmeshTools.CMesh cmesh, cmeshTools.CMesh subdomain_cmesh): # <<<<<<<<<<<<<<
23861  * #need to have Python handles for the cmesh arrays created from apf/PUMI mesh
23862  * cmesh.mesh.subdomainp = &subdomain_cmesh.mesh
23863  */
23864  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_13cpartitioning_5convertPUMIPartitionToPython, NULL, __pyx_n_s_cpartitioning); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 51, __pyx_L1_error)
23865  __Pyx_GOTREF(__pyx_t_2);
23866  if (PyDict_SetItem(__pyx_d, __pyx_n_s_convertPUMIPartitionToPython, __pyx_t_2) < 0) __PYX_ERR(0, 51, __pyx_L1_error)
23867  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
23868 
23869  /* "cpartitioning.pyx":65
23870  * )
23871  *
23872  * def partitionNodesFromTetgenFiles(Comm comm, object filebase, int indexBase, int nLayersOfOverlap, cmeshTools.CMesh cmesh, cmeshTools.CMesh subdomain_cmesh): # <<<<<<<<<<<<<<
23873  * cmesh.mesh.subdomainp = &subdomain_cmesh.mesh
23874  * if not isinstance(filebase, bytes):
23875  */
23876  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_13cpartitioning_7partitionNodesFromTetgenFiles, NULL, __pyx_n_s_cpartitioning); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 65, __pyx_L1_error)
23877  __Pyx_GOTREF(__pyx_t_2);
23878  if (PyDict_SetItem(__pyx_d, __pyx_n_s_partitionNodesFromTetgenFiles, __pyx_t_2) < 0) __PYX_ERR(0, 65, __pyx_L1_error)
23879  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
23880 
23881  /* "cpartitioning.pyx":85
23882  * )
23883  *
23884  * def buildQuadraticLocal2GlobalMappings(Comm comm, # <<<<<<<<<<<<<<
23885  * int nSpace,
23886  * cmeshTools.CMesh cmesh,
23887  */
23888  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_13cpartitioning_9buildQuadraticLocal2GlobalMappings, NULL, __pyx_n_s_cpartitioning); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 85, __pyx_L1_error)
23889  __Pyx_GOTREF(__pyx_t_2);
23890  if (PyDict_SetItem(__pyx_d, __pyx_n_s_buildQuadraticLocal2GlobalMappin, __pyx_t_2) < 0) __PYX_ERR(0, 85, __pyx_L1_error)
23891  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
23892 
23893  /* "cpartitioning.pyx":150
23894  * max_dof_neighbors)
23895  *
23896  * def buildQuadraticCubeLocal2GlobalMappings(Comm comm, # <<<<<<<<<<<<<<
23897  * int nSpace,
23898  * cmeshTools.CMesh cmesh,
23899  */
23900  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_13cpartitioning_11buildQuadraticCubeLocal2GlobalMappings, NULL, __pyx_n_s_cpartitioning); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 150, __pyx_L1_error)
23901  __Pyx_GOTREF(__pyx_t_2);
23902  if (PyDict_SetItem(__pyx_d, __pyx_n_s_buildQuadraticCubeLocal2GlobalMa, __pyx_t_2) < 0) __PYX_ERR(0, 150, __pyx_L1_error)
23903  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
23904 
23905  /* "cpartitioning.pyx":191
23906  * max_dof_neighbors)
23907  *
23908  * def buildDiscontinuousGalerkinLocal2GlobalMappings(Comm comm, # <<<<<<<<<<<<<<
23909  * int nDOF_element,
23910  * cmeshTools.CMesh cmesh,
23911  */
23912  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_13cpartitioning_13buildDiscontinuousGalerkinLocal2GlobalMappings, NULL, __pyx_n_s_cpartitioning); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 191, __pyx_L1_error)
23913  __Pyx_GOTREF(__pyx_t_2);
23914  if (PyDict_SetItem(__pyx_d, __pyx_n_s_buildDiscontinuousGalerkinLocal2, __pyx_t_2) < 0) __PYX_ERR(0, 191, __pyx_L1_error)
23915  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
23916 
23917  /* "cpartitioning.pyx":1
23918  * # A type of -*- python -*- file # <<<<<<<<<<<<<<
23919  * from proteus import Comm as proteus_Comm
23920  * import numpy as np
23921  */
23922  __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1, __pyx_L1_error)
23923  __Pyx_GOTREF(__pyx_t_2);
23924  if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_2) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23925  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
23926 
23927  /* "View.MemoryView":209
23928  * info.obj = self
23929  *
23930  * __pyx_getbuffer = capsule(<void *> &__pyx_array_getbuffer, "getbuffer(obj, view, flags)") # <<<<<<<<<<<<<<
23931  *
23932  * def __dealloc__(array self):
23933  */
23934  __pyx_t_2 = __pyx_capsule_create(((void *)(&__pyx_array_getbuffer)), ((char *)"getbuffer(obj, view, flags)")); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 209, __pyx_L1_error)
23935  __Pyx_GOTREF(__pyx_t_2);
23936  if (PyDict_SetItem((PyObject *)__pyx_array_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_2) < 0) __PYX_ERR(2, 209, __pyx_L1_error)
23937  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
23938  PyType_Modified(__pyx_array_type);
23939 
23940  /* "View.MemoryView":286
23941  * return self.name
23942  *
23943  * cdef generic = Enum("<strided and direct or indirect>") # <<<<<<<<<<<<<<
23944  * cdef strided = Enum("<strided and direct>") # default
23945  * cdef indirect = Enum("<strided and indirect>")
23946  */
23947  __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__45, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 286, __pyx_L1_error)
23948  __Pyx_GOTREF(__pyx_t_2);
23949  __Pyx_XGOTREF(generic);
23950  __Pyx_DECREF_SET(generic, __pyx_t_2);
23951  __Pyx_GIVEREF(__pyx_t_2);
23952  __pyx_t_2 = 0;
23953 
23954  /* "View.MemoryView":287
23955  *
23956  * cdef generic = Enum("<strided and direct or indirect>")
23957  * cdef strided = Enum("<strided and direct>") # default # <<<<<<<<<<<<<<
23958  * cdef indirect = Enum("<strided and indirect>")
23959  *
23960  */
23961  __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__46, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 287, __pyx_L1_error)
23962  __Pyx_GOTREF(__pyx_t_2);
23963  __Pyx_XGOTREF(strided);
23964  __Pyx_DECREF_SET(strided, __pyx_t_2);
23965  __Pyx_GIVEREF(__pyx_t_2);
23966  __pyx_t_2 = 0;
23967 
23968  /* "View.MemoryView":288
23969  * cdef generic = Enum("<strided and direct or indirect>")
23970  * cdef strided = Enum("<strided and direct>") # default
23971  * cdef indirect = Enum("<strided and indirect>") # <<<<<<<<<<<<<<
23972  *
23973  *
23974  */
23975  __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__47, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 288, __pyx_L1_error)
23976  __Pyx_GOTREF(__pyx_t_2);
23977  __Pyx_XGOTREF(indirect);
23978  __Pyx_DECREF_SET(indirect, __pyx_t_2);
23979  __Pyx_GIVEREF(__pyx_t_2);
23980  __pyx_t_2 = 0;
23981 
23982  /* "View.MemoryView":291
23983  *
23984  *
23985  * cdef contiguous = Enum("<contiguous and direct>") # <<<<<<<<<<<<<<
23986  * cdef indirect_contiguous = Enum("<contiguous and indirect>")
23987  *
23988  */
23989  __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__48, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 291, __pyx_L1_error)
23990  __Pyx_GOTREF(__pyx_t_2);
23991  __Pyx_XGOTREF(contiguous);
23992  __Pyx_DECREF_SET(contiguous, __pyx_t_2);
23993  __Pyx_GIVEREF(__pyx_t_2);
23994  __pyx_t_2 = 0;
23995 
23996  /* "View.MemoryView":292
23997  *
23998  * cdef contiguous = Enum("<contiguous and direct>")
23999  * cdef indirect_contiguous = Enum("<contiguous and indirect>") # <<<<<<<<<<<<<<
24000  *
24001  *
24002  */
24003  __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__49, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 292, __pyx_L1_error)
24004  __Pyx_GOTREF(__pyx_t_2);
24005  __Pyx_XGOTREF(indirect_contiguous);
24006  __Pyx_DECREF_SET(indirect_contiguous, __pyx_t_2);
24007  __Pyx_GIVEREF(__pyx_t_2);
24008  __pyx_t_2 = 0;
24009 
24010  /* "View.MemoryView":316
24011  *
24012  * DEF THREAD_LOCKS_PREALLOCATED = 8
24013  * cdef int __pyx_memoryview_thread_locks_used = 0 # <<<<<<<<<<<<<<
24014  * cdef PyThread_type_lock[THREAD_LOCKS_PREALLOCATED] __pyx_memoryview_thread_locks = [
24015  * PyThread_allocate_lock(),
24016  */
24017  __pyx_memoryview_thread_locks_used = 0;
24018 
24019  /* "View.MemoryView":317
24020  * DEF THREAD_LOCKS_PREALLOCATED = 8
24021  * cdef int __pyx_memoryview_thread_locks_used = 0
24022  * cdef PyThread_type_lock[THREAD_LOCKS_PREALLOCATED] __pyx_memoryview_thread_locks = [ # <<<<<<<<<<<<<<
24023  * PyThread_allocate_lock(),
24024  * PyThread_allocate_lock(),
24025  */
24026  __pyx_t_3[0] = PyThread_allocate_lock();
24027  __pyx_t_3[1] = PyThread_allocate_lock();
24028  __pyx_t_3[2] = PyThread_allocate_lock();
24029  __pyx_t_3[3] = PyThread_allocate_lock();
24030  __pyx_t_3[4] = PyThread_allocate_lock();
24031  __pyx_t_3[5] = PyThread_allocate_lock();
24032  __pyx_t_3[6] = PyThread_allocate_lock();
24033  __pyx_t_3[7] = PyThread_allocate_lock();
24034  memcpy(&(__pyx_memoryview_thread_locks[0]), __pyx_t_3, sizeof(__pyx_memoryview_thread_locks[0]) * (8));
24035 
24036  /* "View.MemoryView":545
24037  * info.obj = self
24038  *
24039  * __pyx_getbuffer = capsule(<void *> &__pyx_memoryview_getbuffer, "getbuffer(obj, view, flags)") # <<<<<<<<<<<<<<
24040  *
24041  *
24042  */
24043  __pyx_t_2 = __pyx_capsule_create(((void *)(&__pyx_memoryview_getbuffer)), ((char *)"getbuffer(obj, view, flags)")); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 545, __pyx_L1_error)
24044  __Pyx_GOTREF(__pyx_t_2);
24045  if (PyDict_SetItem((PyObject *)__pyx_memoryview_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_2) < 0) __PYX_ERR(2, 545, __pyx_L1_error)
24046  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
24047  PyType_Modified(__pyx_memoryview_type);
24048 
24049  /* "View.MemoryView":991
24050  * return self.from_object
24051  *
24052  * __pyx_getbuffer = capsule(<void *> &__pyx_memoryview_getbuffer, "getbuffer(obj, view, flags)") # <<<<<<<<<<<<<<
24053  *
24054  *
24055  */
24056  __pyx_t_2 = __pyx_capsule_create(((void *)(&__pyx_memoryview_getbuffer)), ((char *)"getbuffer(obj, view, flags)")); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 991, __pyx_L1_error)
24057  __Pyx_GOTREF(__pyx_t_2);
24058  if (PyDict_SetItem((PyObject *)__pyx_memoryviewslice_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_2) < 0) __PYX_ERR(2, 991, __pyx_L1_error)
24059  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
24060  PyType_Modified(__pyx_memoryviewslice_type);
24061 
24062  /* "(tree fragment)":1
24063  * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<<
24064  * cdef object __pyx_PickleError
24065  * cdef object __pyx_result
24066  */
24067  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_15View_dot_MemoryView_1__pyx_unpickle_Enum, NULL, __pyx_n_s_View_MemoryView); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1, __pyx_L1_error)
24068  __Pyx_GOTREF(__pyx_t_2);
24069  if (PyDict_SetItem(__pyx_d, __pyx_n_s_pyx_unpickle_Enum, __pyx_t_2) < 0) __PYX_ERR(2, 1, __pyx_L1_error)
24070  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
24071 
24072  /* "BufferFormatFromTypeInfo":1460
24073  *
24074  * @cname('__pyx_format_from_typeinfo')
24075  * cdef bytes format_from_typeinfo(__Pyx_TypeInfo *type): # <<<<<<<<<<<<<<
24076  * cdef __Pyx_StructField *field
24077  * cdef __pyx_typeinfo_string fmt
24078  */
24079 
24080  /*--- Wrapped vars code ---*/
24081 
24082  goto __pyx_L0;
24083  __pyx_L1_error:;
24084  __Pyx_XDECREF(__pyx_t_1);
24085  __Pyx_XDECREF(__pyx_t_2);
24086  if (__pyx_m) {
24087  if (__pyx_d) {
24088  __Pyx_AddTraceback("init cpartitioning", __pyx_clineno, __pyx_lineno, __pyx_filename);
24089  }
24090  Py_CLEAR(__pyx_m);
24091  } else if (!PyErr_Occurred()) {
24092  PyErr_SetString(PyExc_ImportError, "init cpartitioning");
24093  }
24094  __pyx_L0:;
24095  __Pyx_RefNannyFinishContext();
24096  #if CYTHON_PEP489_MULTI_PHASE_INIT
24097  return (__pyx_m != NULL) ? 0 : -1;
24098  #elif PY_MAJOR_VERSION >= 3
24099  return __pyx_m;
24100  #else
24101  return;
24102  #endif
24103 }
24104 
24105 /* --- Runtime support code --- */
24106 /* Refnanny */
24107 #if CYTHON_REFNANNY
24108 static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) {
24109  PyObject *m = NULL, *p = NULL;
24110  void *r = NULL;
24111  m = PyImport_ImportModule(modname);
24112  if (!m) goto end;
24113  p = PyObject_GetAttrString(m, "RefNannyAPI");
24114  if (!p) goto end;
24115  r = PyLong_AsVoidPtr(p);
24116 end:
24117  Py_XDECREF(p);
24118  Py_XDECREF(m);
24119  return (__Pyx_RefNannyAPIStruct *)r;
24120 }
24121 #endif
24122 
24123 /* RaiseArgTupleInvalid */
24124 static void __Pyx_RaiseArgtupleInvalid(
24125  const char* func_name,
24126  int exact,
24127  Py_ssize_t num_min,
24128  Py_ssize_t num_max,
24129  Py_ssize_t num_found)
24130 {
24131  Py_ssize_t num_expected;
24132  const char *more_or_less;
24133  if (num_found < num_min) {
24134  num_expected = num_min;
24135  more_or_less = "at least";
24136  } else {
24137  num_expected = num_max;
24138  more_or_less = "at most";
24139  }
24140  if (exact) {
24141  more_or_less = "exactly";
24142  }
24143  PyErr_Format(PyExc_TypeError,
24144  "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)",
24145  func_name, more_or_less, num_expected,
24146  (num_expected == 1) ? "" : "s", num_found);
24147 }
24148 
24149 /* RaiseDoubleKeywords */
24150 static void __Pyx_RaiseDoubleKeywordsError(
24151  const char* func_name,
24152  PyObject* kw_name)
24153 {
24154  PyErr_Format(PyExc_TypeError,
24155  #if PY_MAJOR_VERSION >= 3
24156  "%s() got multiple values for keyword argument '%U'", func_name, kw_name);
24157  #else
24158  "%s() got multiple values for keyword argument '%s'", func_name,
24159  PyString_AsString(kw_name));
24160  #endif
24161 }
24162 
24163 /* ParseKeywords */
24164 static int __Pyx_ParseOptionalKeywords(
24165  PyObject *kwds,
24166  PyObject **argnames[],
24167  PyObject *kwds2,
24168  PyObject *values[],
24169  Py_ssize_t num_pos_args,
24170  const char* function_name)
24171 {
24172  PyObject *key = 0, *value = 0;
24173  Py_ssize_t pos = 0;
24174  PyObject*** name;
24175  PyObject*** first_kw_arg = argnames + num_pos_args;
24176  while (PyDict_Next(kwds, &pos, &key, &value)) {
24177  name = first_kw_arg;
24178  while (*name && (**name != key)) name++;
24179  if (*name) {
24180  values[name-argnames] = value;
24181  continue;
24182  }
24183  name = first_kw_arg;
24184  #if PY_MAJOR_VERSION < 3
24185  if (likely(PyString_CheckExact(key)) || likely(PyString_Check(key))) {
24186  while (*name) {
24187  if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key))
24188  && _PyString_Eq(**name, key)) {
24189  values[name-argnames] = value;
24190  break;
24191  }
24192  name++;
24193  }
24194  if (*name) continue;
24195  else {
24196  PyObject*** argname = argnames;
24197  while (argname != first_kw_arg) {
24198  if ((**argname == key) || (
24199  (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key))
24200  && _PyString_Eq(**argname, key))) {
24201  goto arg_passed_twice;
24202  }
24203  argname++;
24204  }
24205  }
24206  } else
24207  #endif
24208  if (likely(PyUnicode_Check(key))) {
24209  while (*name) {
24210  int cmp = (**name == key) ? 0 :
24211  #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
24212  (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 :
24213  #endif
24214  PyUnicode_Compare(**name, key);
24215  if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
24216  if (cmp == 0) {
24217  values[name-argnames] = value;
24218  break;
24219  }
24220  name++;
24221  }
24222  if (*name) continue;
24223  else {
24224  PyObject*** argname = argnames;
24225  while (argname != first_kw_arg) {
24226  int cmp = (**argname == key) ? 0 :
24227  #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
24228  (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 :
24229  #endif
24230  PyUnicode_Compare(**argname, key);
24231  if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
24232  if (cmp == 0) goto arg_passed_twice;
24233  argname++;
24234  }
24235  }
24236  } else
24237  goto invalid_keyword_type;
24238  if (kwds2) {
24239  if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad;
24240  } else {
24241  goto invalid_keyword;
24242  }
24243  }
24244  return 0;
24245 arg_passed_twice:
24246  __Pyx_RaiseDoubleKeywordsError(function_name, key);
24247  goto bad;
24248 invalid_keyword_type:
24249  PyErr_Format(PyExc_TypeError,
24250  "%.200s() keywords must be strings", function_name);
24251  goto bad;
24252 invalid_keyword:
24253  PyErr_Format(PyExc_TypeError,
24254  #if PY_MAJOR_VERSION < 3
24255  "%.200s() got an unexpected keyword argument '%.200s'",
24256  function_name, PyString_AsString(key));
24257  #else
24258  "%s() got an unexpected keyword argument '%U'",
24259  function_name, key);
24260  #endif
24261 bad:
24262  return -1;
24263 }
24264 
24265 /* ArgTypeTest */
24266 static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact)
24267 {
24268  if (unlikely(!type)) {
24269  PyErr_SetString(PyExc_SystemError, "Missing type object");
24270  return 0;
24271  }
24272  else if (exact) {
24273  #if PY_MAJOR_VERSION == 2
24274  if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj))) return 1;
24275  #endif
24276  }
24277  else {
24278  if (likely(__Pyx_TypeCheck(obj, type))) return 1;
24279  }
24280  PyErr_Format(PyExc_TypeError,
24281  "Argument '%.200s' has incorrect type (expected %.200s, got %.200s)",
24282  name, type->tp_name, Py_TYPE(obj)->tp_name);
24283  return 0;
24284 }
24285 
24286 /* PyObjectGetAttrStr */
24287 #if CYTHON_USE_TYPE_SLOTS
24288 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) {
24289  PyTypeObject* tp = Py_TYPE(obj);
24290  if (likely(tp->tp_getattro))
24291  return tp->tp_getattro(obj, attr_name);
24292 #if PY_MAJOR_VERSION < 3
24293  if (likely(tp->tp_getattr))
24294  return tp->tp_getattr(obj, PyString_AS_STRING(attr_name));
24295 #endif
24296  return PyObject_GetAttr(obj, attr_name);
24297 }
24298 #endif
24299 
24300 /* GetBuiltinName */
24301 static PyObject *__Pyx_GetBuiltinName(PyObject *name) {
24302  PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name);
24303  if (unlikely(!result)) {
24304  PyErr_Format(PyExc_NameError,
24305 #if PY_MAJOR_VERSION >= 3
24306  "name '%U' is not defined", name);
24307 #else
24308  "name '%.200s' is not defined", PyString_AS_STRING(name));
24309 #endif
24310  }
24311  return result;
24312 }
24313 
24314 /* GetModuleGlobalName */
24315 #if CYTHON_USE_DICT_VERSIONS
24316 static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value)
24317 #else
24318 static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name)
24319 #endif
24320 {
24321  PyObject *result;
24322 #if !CYTHON_AVOID_BORROWED_REFS
24323 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1
24324  result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash);
24325  __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
24326  if (likely(result)) {
24327  return __Pyx_NewRef(result);
24328  } else if (unlikely(PyErr_Occurred())) {
24329  return NULL;
24330  }
24331 #else
24332  result = PyDict_GetItem(__pyx_d, name);
24333  __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
24334  if (likely(result)) {
24335  return __Pyx_NewRef(result);
24336  }
24337 #endif
24338 #else
24339  result = PyObject_GetItem(__pyx_d, name);
24340  __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
24341  if (likely(result)) {
24342  return __Pyx_NewRef(result);
24343  }
24344  PyErr_Clear();
24345 #endif
24346  return __Pyx_GetBuiltinName(name);
24347 }
24348 
24349 /* PyIntBinop */
24350 #if !CYTHON_COMPILING_IN_PYPY
24351 static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED long intval, CYTHON_UNUSED int inplace) {
24352  #if PY_MAJOR_VERSION < 3
24353  if (likely(PyInt_CheckExact(op1))) {
24354  const long b = intval;
24355  long x;
24356  long a = PyInt_AS_LONG(op1);
24357  x = (long)((unsigned long)a + b);
24358  if (likely((x^a) >= 0 || (x^b) >= 0))
24359  return PyInt_FromLong(x);
24360  return PyLong_Type.tp_as_number->nb_add(op1, op2);
24361  }
24362  #endif
24363  #if CYTHON_USE_PYLONG_INTERNALS
24364  if (likely(PyLong_CheckExact(op1))) {
24365  const long b = intval;
24366  long a, x;
24367 #ifdef HAVE_LONG_LONG
24368  const PY_LONG_LONG llb = intval;
24369  PY_LONG_LONG lla, llx;
24370 #endif
24371  const digit* digits = ((PyLongObject*)op1)->ob_digit;
24372  const Py_ssize_t size = Py_SIZE(op1);
24373  if (likely(__Pyx_sst_abs(size) <= 1)) {
24374  a = likely(size) ? digits[0] : 0;
24375  if (size == -1) a = -a;
24376  } else {
24377  switch (size) {
24378  case -2:
24379  if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
24380  a = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
24381  break;
24382 #ifdef HAVE_LONG_LONG
24383  } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
24384  lla = -(PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
24385  goto long_long;
24386 #endif
24387  }
24388  CYTHON_FALLTHROUGH;
24389  case 2:
24390  if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
24391  a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
24392  break;
24393 #ifdef HAVE_LONG_LONG
24394  } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
24395  lla = (PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
24396  goto long_long;
24397 #endif
24398  }
24399  CYTHON_FALLTHROUGH;
24400  case -3:
24401  if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
24402  a = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
24403  break;
24404 #ifdef HAVE_LONG_LONG
24405  } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
24406  lla = -(PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
24407  goto long_long;
24408 #endif
24409  }
24410  CYTHON_FALLTHROUGH;
24411  case 3:
24412  if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
24413  a = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
24414  break;
24415 #ifdef HAVE_LONG_LONG
24416  } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
24417  lla = (PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
24418  goto long_long;
24419 #endif
24420  }
24421  CYTHON_FALLTHROUGH;
24422  case -4:
24423  if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
24424  a = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
24425  break;
24426 #ifdef HAVE_LONG_LONG
24427  } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
24428  lla = -(PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
24429  goto long_long;
24430 #endif
24431  }
24432  CYTHON_FALLTHROUGH;
24433  case 4:
24434  if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
24435  a = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
24436  break;
24437 #ifdef HAVE_LONG_LONG
24438  } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
24439  lla = (PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
24440  goto long_long;
24441 #endif
24442  }
24443  CYTHON_FALLTHROUGH;
24444  default: return PyLong_Type.tp_as_number->nb_add(op1, op2);
24445  }
24446  }
24447  x = a + b;
24448  return PyLong_FromLong(x);
24449 #ifdef HAVE_LONG_LONG
24450  long_long:
24451  llx = lla + llb;
24452  return PyLong_FromLongLong(llx);
24453 #endif
24454 
24455 
24456  }
24457  #endif
24458  if (PyFloat_CheckExact(op1)) {
24459  const long b = intval;
24460  double a = PyFloat_AS_DOUBLE(op1);
24461  double result;
24462  PyFPE_START_PROTECT("add", return NULL)
24463  result = ((double)a) + (double)b;
24464  PyFPE_END_PROTECT(result)
24465  return PyFloat_FromDouble(result);
24466  }
24467  return (inplace ? PyNumber_InPlaceAdd : PyNumber_Add)(op1, op2);
24468 }
24469 #endif
24470 
24471 /* PyCFunctionFastCall */
24472 #if CYTHON_FAST_PYCCALL
24473 static CYTHON_INLINE PyObject * __Pyx_PyCFunction_FastCall(PyObject *func_obj, PyObject **args, Py_ssize_t nargs) {
24474  PyCFunctionObject *func = (PyCFunctionObject*)func_obj;
24475  PyCFunction meth = PyCFunction_GET_FUNCTION(func);
24476  PyObject *self = PyCFunction_GET_SELF(func);
24477  int flags = PyCFunction_GET_FLAGS(func);
24478  assert(PyCFunction_Check(func));
24479  assert(METH_FASTCALL == (flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS)));
24480  assert(nargs >= 0);
24481  assert(nargs == 0 || args != NULL);
24482  /* _PyCFunction_FastCallDict() must not be called with an exception set,
24483  because it may clear it (directly or indirectly) and so the
24484  caller loses its exception */
24485  assert(!PyErr_Occurred());
24486  if ((PY_VERSION_HEX < 0x030700A0) || unlikely(flags & METH_KEYWORDS)) {
24487  return (*((__Pyx_PyCFunctionFastWithKeywords)(void*)meth)) (self, args, nargs, NULL);
24488  } else {
24489  return (*((__Pyx_PyCFunctionFast)(void*)meth)) (self, args, nargs);
24490  }
24491 }
24492 #endif
24493 
24494 /* PyFunctionFastCall */
24495 #if CYTHON_FAST_PYCALL
24496 static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na,
24497  PyObject *globals) {
24498  PyFrameObject *f;
24499  PyThreadState *tstate = __Pyx_PyThreadState_Current;
24500  PyObject **fastlocals;
24501  Py_ssize_t i;
24502  PyObject *result;
24503  assert(globals != NULL);
24504  /* XXX Perhaps we should create a specialized
24505  PyFrame_New() that doesn't take locals, but does
24506  take builtins without sanity checking them.
24507  */
24508  assert(tstate != NULL);
24509  f = PyFrame_New(tstate, co, globals, NULL);
24510  if (f == NULL) {
24511  return NULL;
24512  }
24513  fastlocals = __Pyx_PyFrame_GetLocalsplus(f);
24514  for (i = 0; i < na; i++) {
24515  Py_INCREF(*args);
24516  fastlocals[i] = *args++;
24517  }
24518  result = PyEval_EvalFrameEx(f,0);
24519  ++tstate->recursion_depth;
24520  Py_DECREF(f);
24521  --tstate->recursion_depth;
24522  return result;
24523 }
24524 #if 1 || PY_VERSION_HEX < 0x030600B1
24525 static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, int nargs, PyObject *kwargs) {
24526  PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func);
24527  PyObject *globals = PyFunction_GET_GLOBALS(func);
24528  PyObject *argdefs = PyFunction_GET_DEFAULTS(func);
24529  PyObject *closure;
24530 #if PY_MAJOR_VERSION >= 3
24531  PyObject *kwdefs;
24532 #endif
24533  PyObject *kwtuple, **k;
24534  PyObject **d;
24535  Py_ssize_t nd;
24536  Py_ssize_t nk;
24537  PyObject *result;
24538  assert(kwargs == NULL || PyDict_Check(kwargs));
24539  nk = kwargs ? PyDict_Size(kwargs) : 0;
24540  if (Py_EnterRecursiveCall((char*)" while calling a Python object")) {
24541  return NULL;
24542  }
24543  if (
24544 #if PY_MAJOR_VERSION >= 3
24545  co->co_kwonlyargcount == 0 &&
24546 #endif
24547  likely(kwargs == NULL || nk == 0) &&
24548  co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) {
24549  if (argdefs == NULL && co->co_argcount == nargs) {
24550  result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals);
24551  goto done;
24552  }
24553  else if (nargs == 0 && argdefs != NULL
24554  && co->co_argcount == Py_SIZE(argdefs)) {
24555  /* function called with no arguments, but all parameters have
24556  a default value: use default values as arguments .*/
24557  args = &PyTuple_GET_ITEM(argdefs, 0);
24558  result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals);
24559  goto done;
24560  }
24561  }
24562  if (kwargs != NULL) {
24563  Py_ssize_t pos, i;
24564  kwtuple = PyTuple_New(2 * nk);
24565  if (kwtuple == NULL) {
24566  result = NULL;
24567  goto done;
24568  }
24569  k = &PyTuple_GET_ITEM(kwtuple, 0);
24570  pos = i = 0;
24571  while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) {
24572  Py_INCREF(k[i]);
24573  Py_INCREF(k[i+1]);
24574  i += 2;
24575  }
24576  nk = i / 2;
24577  }
24578  else {
24579  kwtuple = NULL;
24580  k = NULL;
24581  }
24582  closure = PyFunction_GET_CLOSURE(func);
24583 #if PY_MAJOR_VERSION >= 3
24584  kwdefs = PyFunction_GET_KW_DEFAULTS(func);
24585 #endif
24586  if (argdefs != NULL) {
24587  d = &PyTuple_GET_ITEM(argdefs, 0);
24588  nd = Py_SIZE(argdefs);
24589  }
24590  else {
24591  d = NULL;
24592  nd = 0;
24593  }
24594 #if PY_MAJOR_VERSION >= 3
24595  result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL,
24596  args, nargs,
24597  k, (int)nk,
24598  d, (int)nd, kwdefs, closure);
24599 #else
24600  result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL,
24601  args, nargs,
24602  k, (int)nk,
24603  d, (int)nd, closure);
24604 #endif
24605  Py_XDECREF(kwtuple);
24606 done:
24607  Py_LeaveRecursiveCall();
24608  return result;
24609 }
24610 #endif
24611 #endif
24612 
24613 /* PyObjectCall */
24614 #if CYTHON_COMPILING_IN_CPYTHON
24615 static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) {
24616  PyObject *result;
24617  ternaryfunc call = func->ob_type->tp_call;
24618  if (unlikely(!call))
24619  return PyObject_Call(func, arg, kw);
24620  if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
24621  return NULL;
24622  result = (*call)(func, arg, kw);
24623  Py_LeaveRecursiveCall();
24624  if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
24625  PyErr_SetString(
24626  PyExc_SystemError,
24627  "NULL result without error in PyObject_Call");
24628  }
24629  return result;
24630 }
24631 #endif
24632 
24633 /* PyObjectCall2Args */
24634 static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2) {
24635  PyObject *args, *result = NULL;
24636  #if CYTHON_FAST_PYCALL
24637  if (PyFunction_Check(function)) {
24638  PyObject *args[2] = {arg1, arg2};
24639  return __Pyx_PyFunction_FastCall(function, args, 2);
24640  }
24641  #endif
24642  #if CYTHON_FAST_PYCCALL
24643  if (__Pyx_PyFastCFunction_Check(function)) {
24644  PyObject *args[2] = {arg1, arg2};
24645  return __Pyx_PyCFunction_FastCall(function, args, 2);
24646  }
24647  #endif
24648  args = PyTuple_New(2);
24649  if (unlikely(!args)) goto done;
24650  Py_INCREF(arg1);
24651  PyTuple_SET_ITEM(args, 0, arg1);
24652  Py_INCREF(arg2);
24653  PyTuple_SET_ITEM(args, 1, arg2);
24654  Py_INCREF(function);
24655  result = __Pyx_PyObject_Call(function, args, NULL);
24656  Py_DECREF(args);
24657  Py_DECREF(function);
24658 done:
24659  return result;
24660 }
24661 
24662 /* PyObjectCallMethO */
24663 #if CYTHON_COMPILING_IN_CPYTHON
24664 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) {
24665  PyObject *self, *result;
24666  PyCFunction cfunc;
24667  cfunc = PyCFunction_GET_FUNCTION(func);
24668  self = PyCFunction_GET_SELF(func);
24669  if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
24670  return NULL;
24671  result = cfunc(self, arg);
24672  Py_LeaveRecursiveCall();
24673  if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
24674  PyErr_SetString(
24675  PyExc_SystemError,
24676  "NULL result without error in PyObject_Call");
24677  }
24678  return result;
24679 }
24680 #endif
24681 
24682 /* PyObjectCallOneArg */
24683 #if CYTHON_COMPILING_IN_CPYTHON
24684 static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) {
24685  PyObject *result;
24686  PyObject *args = PyTuple_New(1);
24687  if (unlikely(!args)) return NULL;
24688  Py_INCREF(arg);
24689  PyTuple_SET_ITEM(args, 0, arg);
24690  result = __Pyx_PyObject_Call(func, args, NULL);
24691  Py_DECREF(args);
24692  return result;
24693 }
24694 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
24695 #if CYTHON_FAST_PYCALL
24696  if (PyFunction_Check(func)) {
24697  return __Pyx_PyFunction_FastCall(func, &arg, 1);
24698  }
24699 #endif
24700  if (likely(PyCFunction_Check(func))) {
24701  if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) {
24702  return __Pyx_PyObject_CallMethO(func, arg);
24703 #if CYTHON_FAST_PYCCALL
24704  } else if (PyCFunction_GET_FLAGS(func) & METH_FASTCALL) {
24705  return __Pyx_PyCFunction_FastCall(func, &arg, 1);
24706 #endif
24707  }
24708  }
24709  return __Pyx__PyObject_CallOneArg(func, arg);
24710 }
24711 #else
24712 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
24713  PyObject *result;
24714  PyObject *args = PyTuple_Pack(1, arg);
24715  if (unlikely(!args)) return NULL;
24716  result = __Pyx_PyObject_Call(func, args, NULL);
24717  Py_DECREF(args);
24718  return result;
24719 }
24720 #endif
24721 
24722 /* PyObjectCallNoArg */
24723 #if CYTHON_COMPILING_IN_CPYTHON
24724 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) {
24725 #if CYTHON_FAST_PYCALL
24726  if (PyFunction_Check(func)) {
24727  return __Pyx_PyFunction_FastCall(func, NULL, 0);
24728  }
24729 #endif
24730 #ifdef __Pyx_CyFunction_USED
24731  if (likely(PyCFunction_Check(func) || __Pyx_CyFunction_Check(func)))
24732 #else
24733  if (likely(PyCFunction_Check(func)))
24734 #endif
24735  {
24736  if (likely(PyCFunction_GET_FLAGS(func) & METH_NOARGS)) {
24737  return __Pyx_PyObject_CallMethO(func, NULL);
24738  }
24739  }
24740  return __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL);
24741 }
24742 #endif
24743 
24744 /* PyErrFetchRestore */
24745 #if CYTHON_FAST_THREAD_STATE
24746 static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
24747  PyObject *tmp_type, *tmp_value, *tmp_tb;
24748  tmp_type = tstate->curexc_type;
24749  tmp_value = tstate->curexc_value;
24750  tmp_tb = tstate->curexc_traceback;
24751  tstate->curexc_type = type;
24752  tstate->curexc_value = value;
24753  tstate->curexc_traceback = tb;
24754  Py_XDECREF(tmp_type);
24755  Py_XDECREF(tmp_value);
24756  Py_XDECREF(tmp_tb);
24757 }
24758 static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
24759  *type = tstate->curexc_type;
24760  *value = tstate->curexc_value;
24761  *tb = tstate->curexc_traceback;
24762  tstate->curexc_type = 0;
24763  tstate->curexc_value = 0;
24764  tstate->curexc_traceback = 0;
24765 }
24766 #endif
24767 
24768 /* RaiseException */
24769 #if PY_MAJOR_VERSION < 3
24770 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb,
24771  CYTHON_UNUSED PyObject *cause) {
24772  __Pyx_PyThreadState_declare
24773  Py_XINCREF(type);
24774  if (!value || value == Py_None)
24775  value = NULL;
24776  else
24777  Py_INCREF(value);
24778  if (!tb || tb == Py_None)
24779  tb = NULL;
24780  else {
24781  Py_INCREF(tb);
24782  if (!PyTraceBack_Check(tb)) {
24783  PyErr_SetString(PyExc_TypeError,
24784  "raise: arg 3 must be a traceback or None");
24785  goto raise_error;
24786  }
24787  }
24788  if (PyType_Check(type)) {
24789 #if CYTHON_COMPILING_IN_PYPY
24790  if (!value) {
24791  Py_INCREF(Py_None);
24792  value = Py_None;
24793  }
24794 #endif
24795  PyErr_NormalizeException(&type, &value, &tb);
24796  } else {
24797  if (value) {
24798  PyErr_SetString(PyExc_TypeError,
24799  "instance exception may not have a separate value");
24800  goto raise_error;
24801  }
24802  value = type;
24803  type = (PyObject*) Py_TYPE(type);
24804  Py_INCREF(type);
24805  if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) {
24806  PyErr_SetString(PyExc_TypeError,
24807  "raise: exception class must be a subclass of BaseException");
24808  goto raise_error;
24809  }
24810  }
24811  __Pyx_PyThreadState_assign
24812  __Pyx_ErrRestore(type, value, tb);
24813  return;
24814 raise_error:
24815  Py_XDECREF(value);
24816  Py_XDECREF(type);
24817  Py_XDECREF(tb);
24818  return;
24819 }
24820 #else
24821 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) {
24822  PyObject* owned_instance = NULL;
24823  if (tb == Py_None) {
24824  tb = 0;
24825  } else if (tb && !PyTraceBack_Check(tb)) {
24826  PyErr_SetString(PyExc_TypeError,
24827  "raise: arg 3 must be a traceback or None");
24828  goto bad;
24829  }
24830  if (value == Py_None)
24831  value = 0;
24832  if (PyExceptionInstance_Check(type)) {
24833  if (value) {
24834  PyErr_SetString(PyExc_TypeError,
24835  "instance exception may not have a separate value");
24836  goto bad;
24837  }
24838  value = type;
24839  type = (PyObject*) Py_TYPE(value);
24840  } else if (PyExceptionClass_Check(type)) {
24841  PyObject *instance_class = NULL;
24842  if (value && PyExceptionInstance_Check(value)) {
24843  instance_class = (PyObject*) Py_TYPE(value);
24844  if (instance_class != type) {
24845  int is_subclass = PyObject_IsSubclass(instance_class, type);
24846  if (!is_subclass) {
24847  instance_class = NULL;
24848  } else if (unlikely(is_subclass == -1)) {
24849  goto bad;
24850  } else {
24851  type = instance_class;
24852  }
24853  }
24854  }
24855  if (!instance_class) {
24856  PyObject *args;
24857  if (!value)
24858  args = PyTuple_New(0);
24859  else if (PyTuple_Check(value)) {
24860  Py_INCREF(value);
24861  args = value;
24862  } else
24863  args = PyTuple_Pack(1, value);
24864  if (!args)
24865  goto bad;
24866  owned_instance = PyObject_Call(type, args, NULL);
24867  Py_DECREF(args);
24868  if (!owned_instance)
24869  goto bad;
24870  value = owned_instance;
24871  if (!PyExceptionInstance_Check(value)) {
24872  PyErr_Format(PyExc_TypeError,
24873  "calling %R should have returned an instance of "
24874  "BaseException, not %R",
24875  type, Py_TYPE(value));
24876  goto bad;
24877  }
24878  }
24879  } else {
24880  PyErr_SetString(PyExc_TypeError,
24881  "raise: exception class must be a subclass of BaseException");
24882  goto bad;
24883  }
24884  if (cause) {
24885  PyObject *fixed_cause;
24886  if (cause == Py_None) {
24887  fixed_cause = NULL;
24888  } else if (PyExceptionClass_Check(cause)) {
24889  fixed_cause = PyObject_CallObject(cause, NULL);
24890  if (fixed_cause == NULL)
24891  goto bad;
24892  } else if (PyExceptionInstance_Check(cause)) {
24893  fixed_cause = cause;
24894  Py_INCREF(fixed_cause);
24895  } else {
24896  PyErr_SetString(PyExc_TypeError,
24897  "exception causes must derive from "
24898  "BaseException");
24899  goto bad;
24900  }
24901  PyException_SetCause(value, fixed_cause);
24902  }
24903  PyErr_SetObject(type, value);
24904  if (tb) {
24905 #if CYTHON_COMPILING_IN_PYPY
24906  PyObject *tmp_type, *tmp_value, *tmp_tb;
24907  PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb);
24908  Py_INCREF(tb);
24909  PyErr_Restore(tmp_type, tmp_value, tb);
24910  Py_XDECREF(tmp_tb);
24911 #else
24912  PyThreadState *tstate = __Pyx_PyThreadState_Current;
24913  PyObject* tmp_tb = tstate->curexc_traceback;
24914  if (tb != tmp_tb) {
24915  Py_INCREF(tb);
24916  tstate->curexc_traceback = tb;
24917  Py_XDECREF(tmp_tb);
24918  }
24919 #endif
24920  }
24921 bad:
24922  Py_XDECREF(owned_instance);
24923  return;
24924 }
24925 #endif
24926 
24927 /* DictGetItem */
24928 #if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY
24929 static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key) {
24930  PyObject *value;
24931  value = PyDict_GetItemWithError(d, key);
24932  if (unlikely(!value)) {
24933  if (!PyErr_Occurred()) {
24934  if (unlikely(PyTuple_Check(key))) {
24935  PyObject* args = PyTuple_Pack(1, key);
24936  if (likely(args)) {
24937  PyErr_SetObject(PyExc_KeyError, args);
24938  Py_DECREF(args);
24939  }
24940  } else {
24941  PyErr_SetObject(PyExc_KeyError, key);
24942  }
24943  }
24944  return NULL;
24945  }
24946  Py_INCREF(value);
24947  return value;
24948 }
24949 #endif
24950 
24951 /* RaiseTooManyValuesToUnpack */
24952 static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) {
24953  PyErr_Format(PyExc_ValueError,
24954  "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T "d)", expected);
24955 }
24956 
24957 /* RaiseNeedMoreValuesToUnpack */
24958 static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) {
24959  PyErr_Format(PyExc_ValueError,
24960  "need more than %" CYTHON_FORMAT_SSIZE_T "d value%.1s to unpack",
24961  index, (index == 1) ? "" : "s");
24962 }
24963 
24964 /* RaiseNoneIterError */
24965 static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void) {
24966  PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
24967 }
24968 
24969 /* ExtTypeTest */
24970 static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) {
24971  if (unlikely(!type)) {
24972  PyErr_SetString(PyExc_SystemError, "Missing type object");
24973  return 0;
24974  }
24975  if (likely(__Pyx_TypeCheck(obj, type)))
24976  return 1;
24977  PyErr_Format(PyExc_TypeError, "Cannot convert %.200s to %.200s",
24978  Py_TYPE(obj)->tp_name, type->tp_name);
24979  return 0;
24980 }
24981 
24982 /* GetTopmostException */
24983 #if CYTHON_USE_EXC_INFO_STACK
24984 static _PyErr_StackItem *
24985 __Pyx_PyErr_GetTopmostException(PyThreadState *tstate)
24986 {
24987  _PyErr_StackItem *exc_info = tstate->exc_info;
24988  while ((exc_info->exc_type == NULL || exc_info->exc_type == Py_None) &&
24989  exc_info->previous_item != NULL)
24990  {
24991  exc_info = exc_info->previous_item;
24992  }
24993  return exc_info;
24994 }
24995 #endif
24996 
24997 /* SaveResetException */
24998 #if CYTHON_FAST_THREAD_STATE
24999 static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
25000  #if CYTHON_USE_EXC_INFO_STACK
25001  _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate);
25002  *type = exc_info->exc_type;
25003  *value = exc_info->exc_value;
25004  *tb = exc_info->exc_traceback;
25005  #else
25006  *type = tstate->exc_type;
25007  *value = tstate->exc_value;
25008  *tb = tstate->exc_traceback;
25009  #endif
25010  Py_XINCREF(*type);
25011  Py_XINCREF(*value);
25012  Py_XINCREF(*tb);
25013 }
25014 static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
25015  PyObject *tmp_type, *tmp_value, *tmp_tb;
25016  #if CYTHON_USE_EXC_INFO_STACK
25017  _PyErr_StackItem *exc_info = tstate->exc_info;
25018  tmp_type = exc_info->exc_type;
25019  tmp_value = exc_info->exc_value;
25020  tmp_tb = exc_info->exc_traceback;
25021  exc_info->exc_type = type;
25022  exc_info->exc_value = value;
25023  exc_info->exc_traceback = tb;
25024  #else
25025  tmp_type = tstate->exc_type;
25026  tmp_value = tstate->exc_value;
25027  tmp_tb = tstate->exc_traceback;
25028  tstate->exc_type = type;
25029  tstate->exc_value = value;
25030  tstate->exc_traceback = tb;
25031  #endif
25032  Py_XDECREF(tmp_type);
25033  Py_XDECREF(tmp_value);
25034  Py_XDECREF(tmp_tb);
25035 }
25036 #endif
25037 
25038 /* PyErrExceptionMatches */
25039 #if CYTHON_FAST_THREAD_STATE
25040 static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
25041  Py_ssize_t i, n;
25042  n = PyTuple_GET_SIZE(tuple);
25043 #if PY_MAJOR_VERSION >= 3
25044  for (i=0; i<n; i++) {
25045  if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
25046  }
25047 #endif
25048  for (i=0; i<n; i++) {
25049  if (__Pyx_PyErr_GivenExceptionMatches(exc_type, PyTuple_GET_ITEM(tuple, i))) return 1;
25050  }
25051  return 0;
25052 }
25053 static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err) {
25054  PyObject *exc_type = tstate->curexc_type;
25055  if (exc_type == err) return 1;
25056  if (unlikely(!exc_type)) return 0;
25057  if (unlikely(PyTuple_Check(err)))
25058  return __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err);
25059  return __Pyx_PyErr_GivenExceptionMatches(exc_type, err);
25060 }
25061 #endif
25062 
25063 /* GetException */
25064 #if CYTHON_FAST_THREAD_STATE
25065 static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb)
25066 #else
25067 static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb)
25068 #endif
25069 {
25070  PyObject *local_type, *local_value, *local_tb;
25071 #if CYTHON_FAST_THREAD_STATE
25072  PyObject *tmp_type, *tmp_value, *tmp_tb;
25073  local_type = tstate->curexc_type;
25074  local_value = tstate->curexc_value;
25075  local_tb = tstate->curexc_traceback;
25076  tstate->curexc_type = 0;
25077  tstate->curexc_value = 0;
25078  tstate->curexc_traceback = 0;
25079 #else
25080  PyErr_Fetch(&local_type, &local_value, &local_tb);
25081 #endif
25082  PyErr_NormalizeException(&local_type, &local_value, &local_tb);
25083 #if CYTHON_FAST_THREAD_STATE
25084  if (unlikely(tstate->curexc_type))
25085 #else
25086  if (unlikely(PyErr_Occurred()))
25087 #endif
25088  goto bad;
25089  #if PY_MAJOR_VERSION >= 3
25090  if (local_tb) {
25091  if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0))
25092  goto bad;
25093  }
25094  #endif
25095  Py_XINCREF(local_tb);
25096  Py_XINCREF(local_type);
25097  Py_XINCREF(local_value);
25098  *type = local_type;
25099  *value = local_value;
25100  *tb = local_tb;
25101 #if CYTHON_FAST_THREAD_STATE
25102  #if CYTHON_USE_EXC_INFO_STACK
25103  {
25104  _PyErr_StackItem *exc_info = tstate->exc_info;
25105  tmp_type = exc_info->exc_type;
25106  tmp_value = exc_info->exc_value;
25107  tmp_tb = exc_info->exc_traceback;
25108  exc_info->exc_type = local_type;
25109  exc_info->exc_value = local_value;
25110  exc_info->exc_traceback = local_tb;
25111  }
25112  #else
25113  tmp_type = tstate->exc_type;
25114  tmp_value = tstate->exc_value;
25115  tmp_tb = tstate->exc_traceback;
25116  tstate->exc_type = local_type;
25117  tstate->exc_value = local_value;
25118  tstate->exc_traceback = local_tb;
25119  #endif
25120  Py_XDECREF(tmp_type);
25121  Py_XDECREF(tmp_value);
25122  Py_XDECREF(tmp_tb);
25123 #else
25124  PyErr_SetExcInfo(local_type, local_value, local_tb);
25125 #endif
25126  return 0;
25127 bad:
25128  *type = 0;
25129  *value = 0;
25130  *tb = 0;
25131  Py_XDECREF(local_type);
25132  Py_XDECREF(local_value);
25133  Py_XDECREF(local_tb);
25134  return -1;
25135 }
25136 
25137 /* BytesEquals */
25138 static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) {
25139 #if CYTHON_COMPILING_IN_PYPY
25140  return PyObject_RichCompareBool(s1, s2, equals);
25141 #else
25142  if (s1 == s2) {
25143  return (equals == Py_EQ);
25144  } else if (PyBytes_CheckExact(s1) & PyBytes_CheckExact(s2)) {
25145  const char *ps1, *ps2;
25146  Py_ssize_t length = PyBytes_GET_SIZE(s1);
25147  if (length != PyBytes_GET_SIZE(s2))
25148  return (equals == Py_NE);
25149  ps1 = PyBytes_AS_STRING(s1);
25150  ps2 = PyBytes_AS_STRING(s2);
25151  if (ps1[0] != ps2[0]) {
25152  return (equals == Py_NE);
25153  } else if (length == 1) {
25154  return (equals == Py_EQ);
25155  } else {
25156  int result;
25157 #if CYTHON_USE_UNICODE_INTERNALS
25158  Py_hash_t hash1, hash2;
25159  hash1 = ((PyBytesObject*)s1)->ob_shash;
25160  hash2 = ((PyBytesObject*)s2)->ob_shash;
25161  if (hash1 != hash2 && hash1 != -1 && hash2 != -1) {
25162  return (equals == Py_NE);
25163  }
25164 #endif
25165  result = memcmp(ps1, ps2, (size_t)length);
25166  return (equals == Py_EQ) ? (result == 0) : (result != 0);
25167  }
25168  } else if ((s1 == Py_None) & PyBytes_CheckExact(s2)) {
25169  return (equals == Py_NE);
25170  } else if ((s2 == Py_None) & PyBytes_CheckExact(s1)) {
25171  return (equals == Py_NE);
25172  } else {
25173  int result;
25174  PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
25175  if (!py_result)
25176  return -1;
25177  result = __Pyx_PyObject_IsTrue(py_result);
25178  Py_DECREF(py_result);
25179  return result;
25180  }
25181 #endif
25182 }
25183 
25184 /* UnicodeEquals */
25185 static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) {
25186 #if CYTHON_COMPILING_IN_PYPY
25187  return PyObject_RichCompareBool(s1, s2, equals);
25188 #else
25189 #if PY_MAJOR_VERSION < 3
25190  PyObject* owned_ref = NULL;
25191 #endif
25192  int s1_is_unicode, s2_is_unicode;
25193  if (s1 == s2) {
25194  goto return_eq;
25195  }
25196  s1_is_unicode = PyUnicode_CheckExact(s1);
25197  s2_is_unicode = PyUnicode_CheckExact(s2);
25198 #if PY_MAJOR_VERSION < 3
25199  if ((s1_is_unicode & (!s2_is_unicode)) && PyString_CheckExact(s2)) {
25200  owned_ref = PyUnicode_FromObject(s2);
25201  if (unlikely(!owned_ref))
25202  return -1;
25203  s2 = owned_ref;
25204  s2_is_unicode = 1;
25205  } else if ((s2_is_unicode & (!s1_is_unicode)) && PyString_CheckExact(s1)) {
25206  owned_ref = PyUnicode_FromObject(s1);
25207  if (unlikely(!owned_ref))
25208  return -1;
25209  s1 = owned_ref;
25210  s1_is_unicode = 1;
25211  } else if (((!s2_is_unicode) & (!s1_is_unicode))) {
25212  return __Pyx_PyBytes_Equals(s1, s2, equals);
25213  }
25214 #endif
25215  if (s1_is_unicode & s2_is_unicode) {
25216  Py_ssize_t length;
25217  int kind;
25218  void *data1, *data2;
25219  if (unlikely(__Pyx_PyUnicode_READY(s1) < 0) || unlikely(__Pyx_PyUnicode_READY(s2) < 0))
25220  return -1;
25221  length = __Pyx_PyUnicode_GET_LENGTH(s1);
25222  if (length != __Pyx_PyUnicode_GET_LENGTH(s2)) {
25223  goto return_ne;
25224  }
25225 #if CYTHON_USE_UNICODE_INTERNALS
25226  {
25227  Py_hash_t hash1, hash2;
25228  #if CYTHON_PEP393_ENABLED
25229  hash1 = ((PyASCIIObject*)s1)->hash;
25230  hash2 = ((PyASCIIObject*)s2)->hash;
25231  #else
25232  hash1 = ((PyUnicodeObject*)s1)->hash;
25233  hash2 = ((PyUnicodeObject*)s2)->hash;
25234  #endif
25235  if (hash1 != hash2 && hash1 != -1 && hash2 != -1) {
25236  goto return_ne;
25237  }
25238  }
25239 #endif
25240  kind = __Pyx_PyUnicode_KIND(s1);
25241  if (kind != __Pyx_PyUnicode_KIND(s2)) {
25242  goto return_ne;
25243  }
25244  data1 = __Pyx_PyUnicode_DATA(s1);
25245  data2 = __Pyx_PyUnicode_DATA(s2);
25246  if (__Pyx_PyUnicode_READ(kind, data1, 0) != __Pyx_PyUnicode_READ(kind, data2, 0)) {
25247  goto return_ne;
25248  } else if (length == 1) {
25249  goto return_eq;
25250  } else {
25251  int result = memcmp(data1, data2, (size_t)(length * kind));
25252  #if PY_MAJOR_VERSION < 3
25253  Py_XDECREF(owned_ref);
25254  #endif
25255  return (equals == Py_EQ) ? (result == 0) : (result != 0);
25256  }
25257  } else if ((s1 == Py_None) & s2_is_unicode) {
25258  goto return_ne;
25259  } else if ((s2 == Py_None) & s1_is_unicode) {
25260  goto return_ne;
25261  } else {
25262  int result;
25263  PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
25264  #if PY_MAJOR_VERSION < 3
25265  Py_XDECREF(owned_ref);
25266  #endif
25267  if (!py_result)
25268  return -1;
25269  result = __Pyx_PyObject_IsTrue(py_result);
25270  Py_DECREF(py_result);
25271  return result;
25272  }
25273 return_eq:
25274  #if PY_MAJOR_VERSION < 3
25275  Py_XDECREF(owned_ref);
25276  #endif
25277  return (equals == Py_EQ);
25278 return_ne:
25279  #if PY_MAJOR_VERSION < 3
25280  Py_XDECREF(owned_ref);
25281  #endif
25282  return (equals == Py_NE);
25283 #endif
25284 }
25285 
25286 /* None */
25287 static CYTHON_INLINE Py_ssize_t __Pyx_div_Py_ssize_t(Py_ssize_t a, Py_ssize_t b) {
25288  Py_ssize_t q = a / b;
25289  Py_ssize_t r = a - q*b;
25290  q -= ((r != 0) & ((r ^ b) < 0));
25291  return q;
25292 }
25293 
25294 /* GetAttr */
25295 static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *o, PyObject *n) {
25296 #if CYTHON_USE_TYPE_SLOTS
25297 #if PY_MAJOR_VERSION >= 3
25298  if (likely(PyUnicode_Check(n)))
25299 #else
25300  if (likely(PyString_Check(n)))
25301 #endif
25302  return __Pyx_PyObject_GetAttrStr(o, n);
25303 #endif
25304  return PyObject_GetAttr(o, n);
25305 }
25306 
25307 /* GetItemInt */
25308 static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) {
25309  PyObject *r;
25310  if (!j) return NULL;
25311  r = PyObject_GetItem(o, j);
25312  Py_DECREF(j);
25313  return r;
25314 }
25315 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
25316  CYTHON_NCP_UNUSED int wraparound,
25317  CYTHON_NCP_UNUSED int boundscheck) {
25318 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
25319  Py_ssize_t wrapped_i = i;
25320  if (wraparound & unlikely(i < 0)) {
25321  wrapped_i += PyList_GET_SIZE(o);
25322  }
25323  if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyList_GET_SIZE(o)))) {
25324  PyObject *r = PyList_GET_ITEM(o, wrapped_i);
25325  Py_INCREF(r);
25326  return r;
25327  }
25328  return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
25329 #else
25330  return PySequence_GetItem(o, i);
25331 #endif
25332 }
25333 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
25334  CYTHON_NCP_UNUSED int wraparound,
25335  CYTHON_NCP_UNUSED int boundscheck) {
25336 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
25337  Py_ssize_t wrapped_i = i;
25338  if (wraparound & unlikely(i < 0)) {
25339  wrapped_i += PyTuple_GET_SIZE(o);
25340  }
25341  if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyTuple_GET_SIZE(o)))) {
25342  PyObject *r = PyTuple_GET_ITEM(o, wrapped_i);
25343  Py_INCREF(r);
25344  return r;
25345  }
25346  return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
25347 #else
25348  return PySequence_GetItem(o, i);
25349 #endif
25350 }
25351 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list,
25352  CYTHON_NCP_UNUSED int wraparound,
25353  CYTHON_NCP_UNUSED int boundscheck) {
25354 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS
25355  if (is_list || PyList_CheckExact(o)) {
25356  Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o);
25357  if ((!boundscheck) || (likely(__Pyx_is_valid_index(n, PyList_GET_SIZE(o))))) {
25358  PyObject *r = PyList_GET_ITEM(o, n);
25359  Py_INCREF(r);
25360  return r;
25361  }
25362  }
25363  else if (PyTuple_CheckExact(o)) {
25364  Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o);
25365  if ((!boundscheck) || likely(__Pyx_is_valid_index(n, PyTuple_GET_SIZE(o)))) {
25366  PyObject *r = PyTuple_GET_ITEM(o, n);
25367  Py_INCREF(r);
25368  return r;
25369  }
25370  } else {
25371  PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence;
25372  if (likely(m && m->sq_item)) {
25373  if (wraparound && unlikely(i < 0) && likely(m->sq_length)) {
25374  Py_ssize_t l = m->sq_length(o);
25375  if (likely(l >= 0)) {
25376  i += l;
25377  } else {
25378  if (!PyErr_ExceptionMatches(PyExc_OverflowError))
25379  return NULL;
25380  PyErr_Clear();
25381  }
25382  }
25383  return m->sq_item(o, i);
25384  }
25385  }
25386 #else
25387  if (is_list || PySequence_Check(o)) {
25388  return PySequence_GetItem(o, i);
25389  }
25390 #endif
25391  return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
25392 }
25393 
25394 /* ObjectGetItem */
25395 #if CYTHON_USE_TYPE_SLOTS
25396 static PyObject *__Pyx_PyObject_GetIndex(PyObject *obj, PyObject* index) {
25397  PyObject *runerr;
25398  Py_ssize_t key_value;
25399  PySequenceMethods *m = Py_TYPE(obj)->tp_as_sequence;
25400  if (unlikely(!(m && m->sq_item))) {
25401  PyErr_Format(PyExc_TypeError, "'%.200s' object is not subscriptable", Py_TYPE(obj)->tp_name);
25402  return NULL;
25403  }
25404  key_value = __Pyx_PyIndex_AsSsize_t(index);
25405  if (likely(key_value != -1 || !(runerr = PyErr_Occurred()))) {
25406  return __Pyx_GetItemInt_Fast(obj, key_value, 0, 1, 1);
25407  }
25408  if (PyErr_GivenExceptionMatches(runerr, PyExc_OverflowError)) {
25409  PyErr_Clear();
25410  PyErr_Format(PyExc_IndexError, "cannot fit '%.200s' into an index-sized integer", Py_TYPE(index)->tp_name);
25411  }
25412  return NULL;
25413 }
25414 static PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject* key) {
25415  PyMappingMethods *m = Py_TYPE(obj)->tp_as_mapping;
25416  if (likely(m && m->mp_subscript)) {
25417  return m->mp_subscript(obj, key);
25418  }
25419  return __Pyx_PyObject_GetIndex(obj, key);
25420 }
25421 #endif
25422 
25423 /* decode_c_string */
25424 static CYTHON_INLINE PyObject* __Pyx_decode_c_string(
25425  const char* cstring, Py_ssize_t start, Py_ssize_t stop,
25426  const char* encoding, const char* errors,
25427  PyObject* (*decode_func)(const char *s, Py_ssize_t size, const char *errors)) {
25428  Py_ssize_t length;
25429  if (unlikely((start < 0) | (stop < 0))) {
25430  size_t slen = strlen(cstring);
25431  if (unlikely(slen > (size_t) PY_SSIZE_T_MAX)) {
25432  PyErr_SetString(PyExc_OverflowError,
25433  "c-string too long to convert to Python");
25434  return NULL;
25435  }
25436  length = (Py_ssize_t) slen;
25437  if (start < 0) {
25438  start += length;
25439  if (start < 0)
25440  start = 0;
25441  }
25442  if (stop < 0)
25443  stop += length;
25444  }
25445  length = stop - start;
25446  if (unlikely(length <= 0))
25447  return PyUnicode_FromUnicode(NULL, 0);
25448  cstring += start;
25449  if (decode_func) {
25450  return decode_func(cstring, length, errors);
25451  } else {
25452  return PyUnicode_Decode(cstring, length, encoding, errors);
25453  }
25454 }
25455 
25456 /* GetAttr3 */
25457 static PyObject *__Pyx_GetAttr3Default(PyObject *d) {
25458  __Pyx_PyThreadState_declare
25459  __Pyx_PyThreadState_assign
25460  if (unlikely(!__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError)))
25461  return NULL;
25462  __Pyx_PyErr_Clear();
25463  Py_INCREF(d);
25464  return d;
25465 }
25466 static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *o, PyObject *n, PyObject *d) {
25467  PyObject *r = __Pyx_GetAttr(o, n);
25468  return (likely(r)) ? r : __Pyx_GetAttr3Default(d);
25469 }
25470 
25471 /* SwapException */
25472 #if CYTHON_FAST_THREAD_STATE
25473 static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
25474  PyObject *tmp_type, *tmp_value, *tmp_tb;
25475  #if CYTHON_USE_EXC_INFO_STACK
25476  _PyErr_StackItem *exc_info = tstate->exc_info;
25477  tmp_type = exc_info->exc_type;
25478  tmp_value = exc_info->exc_value;
25479  tmp_tb = exc_info->exc_traceback;
25480  exc_info->exc_type = *type;
25481  exc_info->exc_value = *value;
25482  exc_info->exc_traceback = *tb;
25483  #else
25484  tmp_type = tstate->exc_type;
25485  tmp_value = tstate->exc_value;
25486  tmp_tb = tstate->exc_traceback;
25487  tstate->exc_type = *type;
25488  tstate->exc_value = *value;
25489  tstate->exc_traceback = *tb;
25490  #endif
25491  *type = tmp_type;
25492  *value = tmp_value;
25493  *tb = tmp_tb;
25494 }
25495 #else
25496 static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb) {
25497  PyObject *tmp_type, *tmp_value, *tmp_tb;
25498  PyErr_GetExcInfo(&tmp_type, &tmp_value, &tmp_tb);
25499  PyErr_SetExcInfo(*type, *value, *tb);
25500  *type = tmp_type;
25501  *value = tmp_value;
25502  *tb = tmp_tb;
25503 }
25504 #endif
25505 
25506 /* Import */
25507 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) {
25508  PyObject *empty_list = 0;
25509  PyObject *module = 0;
25510  PyObject *global_dict = 0;
25511  PyObject *empty_dict = 0;
25512  PyObject *list;
25513  #if PY_MAJOR_VERSION < 3
25514  PyObject *py_import;
25515  py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import);
25516  if (!py_import)
25517  goto bad;
25518  #endif
25519  if (from_list)
25520  list = from_list;
25521  else {
25522  empty_list = PyList_New(0);
25523  if (!empty_list)
25524  goto bad;
25525  list = empty_list;
25526  }
25527  global_dict = PyModule_GetDict(__pyx_m);
25528  if (!global_dict)
25529  goto bad;
25530  empty_dict = PyDict_New();
25531  if (!empty_dict)
25532  goto bad;
25533  {
25534  #if PY_MAJOR_VERSION >= 3
25535  if (level == -1) {
25536  if (strchr(__Pyx_MODULE_NAME, '.')) {
25537  module = PyImport_ImportModuleLevelObject(
25538  name, global_dict, empty_dict, list, 1);
25539  if (!module) {
25540  if (!PyErr_ExceptionMatches(PyExc_ImportError))
25541  goto bad;
25542  PyErr_Clear();
25543  }
25544  }
25545  level = 0;
25546  }
25547  #endif
25548  if (!module) {
25549  #if PY_MAJOR_VERSION < 3
25550  PyObject *py_level = PyInt_FromLong(level);
25551  if (!py_level)
25552  goto bad;
25553  module = PyObject_CallFunctionObjArgs(py_import,
25554  name, global_dict, empty_dict, list, py_level, (PyObject *)NULL);
25555  Py_DECREF(py_level);
25556  #else
25557  module = PyImport_ImportModuleLevelObject(
25558  name, global_dict, empty_dict, list, level);
25559  #endif
25560  }
25561  }
25562 bad:
25563  #if PY_MAJOR_VERSION < 3
25564  Py_XDECREF(py_import);
25565  #endif
25566  Py_XDECREF(empty_list);
25567  Py_XDECREF(empty_dict);
25568  return module;
25569 }
25570 
25571 /* FastTypeChecks */
25572 #if CYTHON_COMPILING_IN_CPYTHON
25573 static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) {
25574  while (a) {
25575  a = a->tp_base;
25576  if (a == b)
25577  return 1;
25578  }
25579  return b == &PyBaseObject_Type;
25580 }
25581 static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) {
25582  PyObject *mro;
25583  if (a == b) return 1;
25584  mro = a->tp_mro;
25585  if (likely(mro)) {
25586  Py_ssize_t i, n;
25587  n = PyTuple_GET_SIZE(mro);
25588  for (i = 0; i < n; i++) {
25589  if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b)
25590  return 1;
25591  }
25592  return 0;
25593  }
25594  return __Pyx_InBases(a, b);
25595 }
25596 #if PY_MAJOR_VERSION == 2
25597 static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) {
25598  PyObject *exception, *value, *tb;
25599  int res;
25600  __Pyx_PyThreadState_declare
25601  __Pyx_PyThreadState_assign
25602  __Pyx_ErrFetch(&exception, &value, &tb);
25603  res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0;
25604  if (unlikely(res == -1)) {
25605  PyErr_WriteUnraisable(err);
25606  res = 0;
25607  }
25608  if (!res) {
25609  res = PyObject_IsSubclass(err, exc_type2);
25610  if (unlikely(res == -1)) {
25611  PyErr_WriteUnraisable(err);
25612  res = 0;
25613  }
25614  }
25615  __Pyx_ErrRestore(exception, value, tb);
25616  return res;
25617 }
25618 #else
25619 static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) {
25620  int res = exc_type1 ? __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type1) : 0;
25621  if (!res) {
25622  res = __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2);
25623  }
25624  return res;
25625 }
25626 #endif
25627 static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
25628  Py_ssize_t i, n;
25629  assert(PyExceptionClass_Check(exc_type));
25630  n = PyTuple_GET_SIZE(tuple);
25631 #if PY_MAJOR_VERSION >= 3
25632  for (i=0; i<n; i++) {
25633  if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
25634  }
25635 #endif
25636  for (i=0; i<n; i++) {
25637  PyObject *t = PyTuple_GET_ITEM(tuple, i);
25638  #if PY_MAJOR_VERSION < 3
25639  if (likely(exc_type == t)) return 1;
25640  #endif
25641  if (likely(PyExceptionClass_Check(t))) {
25642  if (__Pyx_inner_PyErr_GivenExceptionMatches2(exc_type, NULL, t)) return 1;
25643  } else {
25644  }
25645  }
25646  return 0;
25647 }
25648 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject* exc_type) {
25649  if (likely(err == exc_type)) return 1;
25650  if (likely(PyExceptionClass_Check(err))) {
25651  if (likely(PyExceptionClass_Check(exc_type))) {
25652  return __Pyx_inner_PyErr_GivenExceptionMatches2(err, NULL, exc_type);
25653  } else if (likely(PyTuple_Check(exc_type))) {
25654  return __Pyx_PyErr_GivenExceptionMatchesTuple(err, exc_type);
25655  } else {
25656  }
25657  }
25658  return PyErr_GivenExceptionMatches(err, exc_type);
25659 }
25660 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *exc_type1, PyObject *exc_type2) {
25661  assert(PyExceptionClass_Check(exc_type1));
25662  assert(PyExceptionClass_Check(exc_type2));
25663  if (likely(err == exc_type1 || err == exc_type2)) return 1;
25664  if (likely(PyExceptionClass_Check(err))) {
25665  return __Pyx_inner_PyErr_GivenExceptionMatches2(err, exc_type1, exc_type2);
25666  }
25667  return (PyErr_GivenExceptionMatches(err, exc_type1) || PyErr_GivenExceptionMatches(err, exc_type2));
25668 }
25669 #endif
25670 
25671 /* None */
25672 static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname) {
25673  PyErr_Format(PyExc_UnboundLocalError, "local variable '%s' referenced before assignment", varname);
25674 }
25675 
25676 /* None */
25677 static CYTHON_INLINE long __Pyx_div_long(long a, long b) {
25678  long q = a / b;
25679  long r = a - q*b;
25680  q -= ((r != 0) & ((r ^ b) < 0));
25681  return q;
25682 }
25683 
25684 /* WriteUnraisableException */
25685 static void __Pyx_WriteUnraisable(const char *name, CYTHON_UNUSED int clineno,
25686  CYTHON_UNUSED int lineno, CYTHON_UNUSED const char *filename,
25687  int full_traceback, CYTHON_UNUSED int nogil) {
25688  PyObject *old_exc, *old_val, *old_tb;
25689  PyObject *ctx;
25690  __Pyx_PyThreadState_declare
25691 #ifdef WITH_THREAD
25692  PyGILState_STATE state;
25693  if (nogil)
25694  state = PyGILState_Ensure();
25695 #ifdef _MSC_VER
25696  else state = (PyGILState_STATE)-1;
25697 #endif
25698 #endif
25699  __Pyx_PyThreadState_assign
25700  __Pyx_ErrFetch(&old_exc, &old_val, &old_tb);
25701  if (full_traceback) {
25702  Py_XINCREF(old_exc);
25703  Py_XINCREF(old_val);
25704  Py_XINCREF(old_tb);
25705  __Pyx_ErrRestore(old_exc, old_val, old_tb);
25706  PyErr_PrintEx(1);
25707  }
25708  #if PY_MAJOR_VERSION < 3
25709  ctx = PyString_FromString(name);
25710  #else
25711  ctx = PyUnicode_FromString(name);
25712  #endif
25713  __Pyx_ErrRestore(old_exc, old_val, old_tb);
25714  if (!ctx) {
25715  PyErr_WriteUnraisable(Py_None);
25716  } else {
25717  PyErr_WriteUnraisable(ctx);
25718  Py_DECREF(ctx);
25719  }
25720 #ifdef WITH_THREAD
25721  if (nogil)
25722  PyGILState_Release(state);
25723 #endif
25724 }
25725 
25726 /* ImportFrom */
25727 static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) {
25728  PyObject* value = __Pyx_PyObject_GetAttrStr(module, name);
25729  if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) {
25730  PyErr_Format(PyExc_ImportError,
25731  #if PY_MAJOR_VERSION < 3
25732  "cannot import name %.230s", PyString_AS_STRING(name));
25733  #else
25734  "cannot import name %S", name);
25735  #endif
25736  }
25737  return value;
25738 }
25739 
25740 /* HasAttr */
25741 static CYTHON_INLINE int __Pyx_HasAttr(PyObject *o, PyObject *n) {
25742  PyObject *r;
25743  if (unlikely(!__Pyx_PyBaseString_Check(n))) {
25744  PyErr_SetString(PyExc_TypeError,
25745  "hasattr(): attribute name must be string");
25746  return -1;
25747  }
25748  r = __Pyx_GetAttr(o, n);
25749  if (unlikely(!r)) {
25750  PyErr_Clear();
25751  return 0;
25752  } else {
25753  Py_DECREF(r);
25754  return 1;
25755  }
25756 }
25757 
25758 /* StringJoin */
25759 #if !CYTHON_COMPILING_IN_CPYTHON
25760 static CYTHON_INLINE PyObject* __Pyx_PyBytes_Join(PyObject* sep, PyObject* values) {
25761  return PyObject_CallMethodObjArgs(sep, __pyx_n_s_join, values, NULL);
25762 }
25763 #endif
25764 
25765 /* PyObject_GenericGetAttrNoDict */
25766 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
25767 static PyObject *__Pyx_RaiseGenericGetAttributeError(PyTypeObject *tp, PyObject *attr_name) {
25768  PyErr_Format(PyExc_AttributeError,
25769 #if PY_MAJOR_VERSION >= 3
25770  "'%.50s' object has no attribute '%U'",
25771  tp->tp_name, attr_name);
25772 #else
25773  "'%.50s' object has no attribute '%.400s'",
25774  tp->tp_name, PyString_AS_STRING(attr_name));
25775 #endif
25776  return NULL;
25777 }
25778 static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name) {
25779  PyObject *descr;
25780  PyTypeObject *tp = Py_TYPE(obj);
25781  if (unlikely(!PyString_Check(attr_name))) {
25782  return PyObject_GenericGetAttr(obj, attr_name);
25783  }
25784  assert(!tp->tp_dictoffset);
25785  descr = _PyType_Lookup(tp, attr_name);
25786  if (unlikely(!descr)) {
25787  return __Pyx_RaiseGenericGetAttributeError(tp, attr_name);
25788  }
25789  Py_INCREF(descr);
25790  #if PY_MAJOR_VERSION < 3
25791  if (likely(PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_HAVE_CLASS)))
25792  #endif
25793  {
25794  descrgetfunc f = Py_TYPE(descr)->tp_descr_get;
25795  if (unlikely(f)) {
25796  PyObject *res = f(descr, obj, (PyObject *)tp);
25797  Py_DECREF(descr);
25798  return res;
25799  }
25800  }
25801  return descr;
25802 }
25803 #endif
25804 
25805 /* PyObject_GenericGetAttr */
25806 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
25807 static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name) {
25808  if (unlikely(Py_TYPE(obj)->tp_dictoffset)) {
25809  return PyObject_GenericGetAttr(obj, attr_name);
25810  }
25811  return __Pyx_PyObject_GenericGetAttrNoDict(obj, attr_name);
25812 }
25813 #endif
25814 
25815 /* SetVTable */
25816 static int __Pyx_SetVtable(PyObject *dict, void *vtable) {
25817 #if PY_VERSION_HEX >= 0x02070000
25818  PyObject *ob = PyCapsule_New(vtable, 0, 0);
25819 #else
25820  PyObject *ob = PyCObject_FromVoidPtr(vtable, 0);
25821 #endif
25822  if (!ob)
25823  goto bad;
25824  if (PyDict_SetItem(dict, __pyx_n_s_pyx_vtable, ob) < 0)
25825  goto bad;
25826  Py_DECREF(ob);
25827  return 0;
25828 bad:
25829  Py_XDECREF(ob);
25830  return -1;
25831 }
25832 
25833 /* SetupReduce */
25834 static int __Pyx_setup_reduce_is_named(PyObject* meth, PyObject* name) {
25835  int ret;
25836  PyObject *name_attr;
25837  name_attr = __Pyx_PyObject_GetAttrStr(meth, __pyx_n_s_name_2);
25838  if (likely(name_attr)) {
25839  ret = PyObject_RichCompareBool(name_attr, name, Py_EQ);
25840  } else {
25841  ret = -1;
25842  }
25843  if (unlikely(ret < 0)) {
25844  PyErr_Clear();
25845  ret = 0;
25846  }
25847  Py_XDECREF(name_attr);
25848  return ret;
25849 }
25850 static int __Pyx_setup_reduce(PyObject* type_obj) {
25851  int ret = 0;
25852  PyObject *object_reduce = NULL;
25853  PyObject *object_reduce_ex = NULL;
25854  PyObject *reduce = NULL;
25855  PyObject *reduce_ex = NULL;
25856  PyObject *reduce_cython = NULL;
25857  PyObject *setstate = NULL;
25858  PyObject *setstate_cython = NULL;
25859 #if CYTHON_USE_PYTYPE_LOOKUP
25860  if (_PyType_Lookup((PyTypeObject*)type_obj, __pyx_n_s_getstate)) goto GOOD;
25861 #else
25862  if (PyObject_HasAttr(type_obj, __pyx_n_s_getstate)) goto GOOD;
25863 #endif
25864 #if CYTHON_USE_PYTYPE_LOOKUP
25865  object_reduce_ex = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto BAD;
25866 #else
25867  object_reduce_ex = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto BAD;
25868 #endif
25869  reduce_ex = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce_ex); if (unlikely(!reduce_ex)) goto BAD;
25870  if (reduce_ex == object_reduce_ex) {
25871 #if CYTHON_USE_PYTYPE_LOOKUP
25872  object_reduce = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto BAD;
25873 #else
25874  object_reduce = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto BAD;
25875 #endif
25876  reduce = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce); if (unlikely(!reduce)) goto BAD;
25877  if (reduce == object_reduce || __Pyx_setup_reduce_is_named(reduce, __pyx_n_s_reduce_cython)) {
25878  reduce_cython = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce_cython); if (unlikely(!reduce_cython)) goto BAD;
25879  ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce, reduce_cython); if (unlikely(ret < 0)) goto BAD;
25880  ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce_cython); if (unlikely(ret < 0)) goto BAD;
25881  setstate = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_setstate);
25882  if (!setstate) PyErr_Clear();
25883  if (!setstate || __Pyx_setup_reduce_is_named(setstate, __pyx_n_s_setstate_cython)) {
25884  setstate_cython = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_setstate_cython); if (unlikely(!setstate_cython)) goto BAD;
25885  ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate, setstate_cython); if (unlikely(ret < 0)) goto BAD;
25886  ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate_cython); if (unlikely(ret < 0)) goto BAD;
25887  }
25888  PyType_Modified((PyTypeObject*)type_obj);
25889  }
25890  }
25891  goto GOOD;
25892 BAD:
25893  if (!PyErr_Occurred())
25894  PyErr_Format(PyExc_RuntimeError, "Unable to initialize pickling for %s", ((PyTypeObject*)type_obj)->tp_name);
25895  ret = -1;
25896 GOOD:
25897 #if !CYTHON_USE_PYTYPE_LOOKUP
25898  Py_XDECREF(object_reduce);
25899  Py_XDECREF(object_reduce_ex);
25900 #endif
25901  Py_XDECREF(reduce);
25902  Py_XDECREF(reduce_ex);
25903  Py_XDECREF(reduce_cython);
25904  Py_XDECREF(setstate);
25905  Py_XDECREF(setstate_cython);
25906  return ret;
25907 }
25908 
25909 /* TypeImport */
25910 #ifndef __PYX_HAVE_RT_ImportType
25911 #define __PYX_HAVE_RT_ImportType
25912 static PyTypeObject *__Pyx_ImportType(PyObject *module, const char *module_name, const char *class_name,
25913  size_t size, enum __Pyx_ImportType_CheckSize check_size)
25914 {
25915  PyObject *result = 0;
25916  char warning[200];
25917  Py_ssize_t basicsize;
25918 #ifdef Py_LIMITED_API
25919  PyObject *py_basicsize;
25920 #endif
25921  result = PyObject_GetAttrString(module, class_name);
25922  if (!result)
25923  goto bad;
25924  if (!PyType_Check(result)) {
25925  PyErr_Format(PyExc_TypeError,
25926  "%.200s.%.200s is not a type object",
25927  module_name, class_name);
25928  goto bad;
25929  }
25930 #ifndef Py_LIMITED_API
25931  basicsize = ((PyTypeObject *)result)->tp_basicsize;
25932 #else
25933  py_basicsize = PyObject_GetAttrString(result, "__basicsize__");
25934  if (!py_basicsize)
25935  goto bad;
25936  basicsize = PyLong_AsSsize_t(py_basicsize);
25937  Py_DECREF(py_basicsize);
25938  py_basicsize = 0;
25939  if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred())
25940  goto bad;
25941 #endif
25942  if ((size_t)basicsize < size) {
25943  PyErr_Format(PyExc_ValueError,
25944  "%.200s.%.200s size changed, may indicate binary incompatibility. "
25945  "Expected %zd from C header, got %zd from PyObject",
25946  module_name, class_name, size, basicsize);
25947  goto bad;
25948  }
25949  if (check_size == __Pyx_ImportType_CheckSize_Error && (size_t)basicsize != size) {
25950  PyErr_Format(PyExc_ValueError,
25951  "%.200s.%.200s size changed, may indicate binary incompatibility. "
25952  "Expected %zd from C header, got %zd from PyObject",
25953  module_name, class_name, size, basicsize);
25954  goto bad;
25955  }
25956  else if (check_size == __Pyx_ImportType_CheckSize_Warn && (size_t)basicsize > size) {
25957  PyOS_snprintf(warning, sizeof(warning),
25958  "%s.%s size changed, may indicate binary incompatibility. "
25959  "Expected %zd from C header, got %zd from PyObject",
25960  module_name, class_name, size, basicsize);
25961  if (PyErr_WarnEx(NULL, warning, 0) < 0) goto bad;
25962  }
25963  return (PyTypeObject *)result;
25964 bad:
25965  Py_XDECREF(result);
25966  return NULL;
25967 }
25968 #endif
25969 
25970 /* CLineInTraceback */
25971 #ifndef CYTHON_CLINE_IN_TRACEBACK
25972 static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line) {
25973  PyObject *use_cline;
25974  PyObject *ptype, *pvalue, *ptraceback;
25975 #if CYTHON_COMPILING_IN_CPYTHON
25976  PyObject **cython_runtime_dict;
25977 #endif
25978  if (unlikely(!__pyx_cython_runtime)) {
25979  return c_line;
25980  }
25981  __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
25982 #if CYTHON_COMPILING_IN_CPYTHON
25983  cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime);
25984  if (likely(cython_runtime_dict)) {
25985  __PYX_PY_DICT_LOOKUP_IF_MODIFIED(
25986  use_cline, *cython_runtime_dict,
25987  __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback))
25988  } else
25989 #endif
25990  {
25991  PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback);
25992  if (use_cline_obj) {
25993  use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True;
25994  Py_DECREF(use_cline_obj);
25995  } else {
25996  PyErr_Clear();
25997  use_cline = NULL;
25998  }
25999  }
26000  if (!use_cline) {
26001  c_line = 0;
26002  PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False);
26003  }
26004  else if (use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) {
26005  c_line = 0;
26006  }
26007  __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
26008  return c_line;
26009 }
26010 #endif
26011 
26012 /* CodeObjectCache */
26013 static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) {
26014  int start = 0, mid = 0, end = count - 1;
26015  if (end >= 0 && code_line > entries[end].code_line) {
26016  return count;
26017  }
26018  while (start < end) {
26019  mid = start + (end - start) / 2;
26020  if (code_line < entries[mid].code_line) {
26021  end = mid;
26022  } else if (code_line > entries[mid].code_line) {
26023  start = mid + 1;
26024  } else {
26025  return mid;
26026  }
26027  }
26028  if (code_line <= entries[mid].code_line) {
26029  return mid;
26030  } else {
26031  return mid + 1;
26032  }
26033 }
26034 static PyCodeObject *__pyx_find_code_object(int code_line) {
26035  PyCodeObject* code_object;
26036  int pos;
26037  if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) {
26038  return NULL;
26039  }
26040  pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
26041  if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) {
26042  return NULL;
26043  }
26044  code_object = __pyx_code_cache.entries[pos].code_object;
26045  Py_INCREF(code_object);
26046  return code_object;
26047 }
26048 static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) {
26049  int pos, i;
26050  __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries;
26051  if (unlikely(!code_line)) {
26052  return;
26053  }
26054  if (unlikely(!entries)) {
26055  entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry));
26056  if (likely(entries)) {
26057  __pyx_code_cache.entries = entries;
26058  __pyx_code_cache.max_count = 64;
26059  __pyx_code_cache.count = 1;
26060  entries[0].code_line = code_line;
26061  entries[0].code_object = code_object;
26062  Py_INCREF(code_object);
26063  }
26064  return;
26065  }
26066  pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
26067  if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) {
26068  PyCodeObject* tmp = entries[pos].code_object;
26069  entries[pos].code_object = code_object;
26070  Py_DECREF(tmp);
26071  return;
26072  }
26073  if (__pyx_code_cache.count == __pyx_code_cache.max_count) {
26074  int new_max = __pyx_code_cache.max_count + 64;
26075  entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc(
26076  __pyx_code_cache.entries, (size_t)new_max*sizeof(__Pyx_CodeObjectCacheEntry));
26077  if (unlikely(!entries)) {
26078  return;
26079  }
26080  __pyx_code_cache.entries = entries;
26081  __pyx_code_cache.max_count = new_max;
26082  }
26083  for (i=__pyx_code_cache.count; i>pos; i--) {
26084  entries[i] = entries[i-1];
26085  }
26086  entries[pos].code_line = code_line;
26087  entries[pos].code_object = code_object;
26088  __pyx_code_cache.count++;
26089  Py_INCREF(code_object);
26090 }
26091 
26092 /* AddTraceback */
26093 #include "compile.h"
26094 #include "frameobject.h"
26095 #include "traceback.h"
26096 static PyCodeObject* __Pyx_CreateCodeObjectForTraceback(
26097  const char *funcname, int c_line,
26098  int py_line, const char *filename) {
26099  PyCodeObject *py_code = 0;
26100  PyObject *py_srcfile = 0;
26101  PyObject *py_funcname = 0;
26102  #if PY_MAJOR_VERSION < 3
26103  py_srcfile = PyString_FromString(filename);
26104  #else
26105  py_srcfile = PyUnicode_FromString(filename);
26106  #endif
26107  if (!py_srcfile) goto bad;
26108  if (c_line) {
26109  #if PY_MAJOR_VERSION < 3
26110  py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
26111  #else
26112  py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
26113  #endif
26114  }
26115  else {
26116  #if PY_MAJOR_VERSION < 3
26117  py_funcname = PyString_FromString(funcname);
26118  #else
26119  py_funcname = PyUnicode_FromString(funcname);
26120  #endif
26121  }
26122  if (!py_funcname) goto bad;
26123  py_code = __Pyx_PyCode_New(
26124  0,
26125  0,
26126  0,
26127  0,
26128  0,
26129  __pyx_empty_bytes, /*PyObject *code,*/
26130  __pyx_empty_tuple, /*PyObject *consts,*/
26131  __pyx_empty_tuple, /*PyObject *names,*/
26132  __pyx_empty_tuple, /*PyObject *varnames,*/
26133  __pyx_empty_tuple, /*PyObject *freevars,*/
26134  __pyx_empty_tuple, /*PyObject *cellvars,*/
26135  py_srcfile, /*PyObject *filename,*/
26136  py_funcname, /*PyObject *name,*/
26137  py_line,
26138  __pyx_empty_bytes /*PyObject *lnotab*/
26139  );
26140  Py_DECREF(py_srcfile);
26141  Py_DECREF(py_funcname);
26142  return py_code;
26143 bad:
26144  Py_XDECREF(py_srcfile);
26145  Py_XDECREF(py_funcname);
26146  return NULL;
26147 }
26148 static void __Pyx_AddTraceback(const char *funcname, int c_line,
26149  int py_line, const char *filename) {
26150  PyCodeObject *py_code = 0;
26151  PyFrameObject *py_frame = 0;
26152  PyThreadState *tstate = __Pyx_PyThreadState_Current;
26153  if (c_line) {
26154  c_line = __Pyx_CLineForTraceback(tstate, c_line);
26155  }
26156  py_code = __pyx_find_code_object(c_line ? -c_line : py_line);
26157  if (!py_code) {
26158  py_code = __Pyx_CreateCodeObjectForTraceback(
26159  funcname, c_line, py_line, filename);
26160  if (!py_code) goto bad;
26161  __pyx_insert_code_object(c_line ? -c_line : py_line, py_code);
26162  }
26163  py_frame = PyFrame_New(
26164  tstate, /*PyThreadState *tstate,*/
26165  py_code, /*PyCodeObject *code,*/
26166  __pyx_d, /*PyObject *globals,*/
26167  0 /*PyObject *locals*/
26168  );
26169  if (!py_frame) goto bad;
26170  __Pyx_PyFrame_SetLineNumber(py_frame, py_line);
26171  PyTraceBack_Here(py_frame);
26172 bad:
26173  Py_XDECREF(py_code);
26174  Py_XDECREF(py_frame);
26175 }
26176 
26177 /* CIntFromPyVerify */
26178 #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\
26179  __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0)
26180 #define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\
26181  __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1)
26182 #define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\
26183  {\
26184  func_type value = func_value;\
26185  if (sizeof(target_type) < sizeof(func_type)) {\
26186  if (unlikely(value != (func_type) (target_type) value)) {\
26187  func_type zero = 0;\
26188  if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\
26189  return (target_type) -1;\
26190  if (is_unsigned && unlikely(value < zero))\
26191  goto raise_neg_overflow;\
26192  else\
26193  goto raise_overflow;\
26194  }\
26195  }\
26196  return (target_type) value;\
26197  }
26198 
26199 /* CIntToPy */
26200 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) {
26201  const int neg_one = (int) ((int) 0 - (int) 1), const_zero = (int) 0;
26202  const int is_unsigned = neg_one > const_zero;
26203  if (is_unsigned) {
26204  if (sizeof(int) < sizeof(long)) {
26205  return PyInt_FromLong((long) value);
26206  } else if (sizeof(int) <= sizeof(unsigned long)) {
26207  return PyLong_FromUnsignedLong((unsigned long) value);
26208 #ifdef HAVE_LONG_LONG
26209  } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) {
26210  return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
26211 #endif
26212  }
26213  } else {
26214  if (sizeof(int) <= sizeof(long)) {
26215  return PyInt_FromLong((long) value);
26216 #ifdef HAVE_LONG_LONG
26217  } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) {
26218  return PyLong_FromLongLong((PY_LONG_LONG) value);
26219 #endif
26220  }
26221  }
26222  {
26223  int one = 1; int little = (int)*(unsigned char *)&one;
26224  unsigned char *bytes = (unsigned char *)&value;
26225  return _PyLong_FromByteArray(bytes, sizeof(int),
26226  little, !is_unsigned);
26227  }
26228 }
26229 
26230 /* MemviewDtypeToObject */
26231 static CYTHON_INLINE PyObject *__pyx_memview_get_int(const char *itemp) {
26232  return (PyObject *) __Pyx_PyInt_From_int(*(int *) itemp);
26233 }
26234 static CYTHON_INLINE int __pyx_memview_set_int(const char *itemp, PyObject *obj) {
26235  int value = __Pyx_PyInt_As_int(obj);
26236  if ((value == (int)-1) && PyErr_Occurred())
26237  return 0;
26238  *(int *) itemp = value;
26239  return 1;
26240 }
26241 
26242 /* Declarations */
26243 #if CYTHON_CCOMPLEX
26244  #ifdef __cplusplus
26245  static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
26246  return ::std::complex< float >(x, y);
26247  }
26248  #else
26249  static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
26250  return x + y*(__pyx_t_float_complex)_Complex_I;
26251  }
26252  #endif
26253 #else
26254  static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
26255  __pyx_t_float_complex z;
26256  z.real = x;
26257  z.imag = y;
26258  return z;
26259  }
26260 #endif
26261 
26262 /* Arithmetic */
26263 #if CYTHON_CCOMPLEX
26264 #else
26265  static CYTHON_INLINE int __Pyx_c_eq_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
26266  return (a.real == b.real) && (a.imag == b.imag);
26267  }
26268  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sum_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
26269  __pyx_t_float_complex z;
26270  z.real = a.real + b.real;
26271  z.imag = a.imag + b.imag;
26272  return z;
26273  }
26274  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_diff_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
26275  __pyx_t_float_complex z;
26276  z.real = a.real - b.real;
26277  z.imag = a.imag - b.imag;
26278  return z;
26279  }
26280  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prod_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
26281  __pyx_t_float_complex z;
26282  z.real = a.real * b.real - a.imag * b.imag;
26283  z.imag = a.real * b.imag + a.imag * b.real;
26284  return z;
26285  }
26286  #if 1
26287  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
26288  if (b.imag == 0) {
26289  return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.real);
26290  } else if (fabsf(b.real) >= fabsf(b.imag)) {
26291  if (b.real == 0 && b.imag == 0) {
26292  return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.imag);
26293  } else {
26294  float r = b.imag / b.real;
26295  float s = 1.0 / (b.real + b.imag * r);
26296  return __pyx_t_float_complex_from_parts(
26297  (a.real + a.imag * r) * s, (a.imag - a.real * r) * s);
26298  }
26299  } else {
26300  float r = b.real / b.imag;
26301  float s = 1.0 / (b.imag + b.real * r);
26302  return __pyx_t_float_complex_from_parts(
26303  (a.real * r + a.imag) * s, (a.imag * r - a.real) * s);
26304  }
26305  }
26306  #else
26307  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
26308  if (b.imag == 0) {
26309  return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.real);
26310  } else {
26311  float denom = b.real * b.real + b.imag * b.imag;
26312  return __pyx_t_float_complex_from_parts(
26313  (a.real * b.real + a.imag * b.imag) / denom,
26314  (a.imag * b.real - a.real * b.imag) / denom);
26315  }
26316  }
26317  #endif
26318  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_neg_float(__pyx_t_float_complex a) {
26319  __pyx_t_float_complex z;
26320  z.real = -a.real;
26321  z.imag = -a.imag;
26322  return z;
26323  }
26324  static CYTHON_INLINE int __Pyx_c_is_zero_float(__pyx_t_float_complex a) {
26325  return (a.real == 0) && (a.imag == 0);
26326  }
26327  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conj_float(__pyx_t_float_complex a) {
26328  __pyx_t_float_complex z;
26329  z.real = a.real;
26330  z.imag = -a.imag;
26331  return z;
26332  }
26333  #if 1
26334  static CYTHON_INLINE float __Pyx_c_abs_float(__pyx_t_float_complex z) {
26335  #if !defined(HAVE_HYPOT) || defined(_MSC_VER)
26336  return sqrtf(z.real*z.real + z.imag*z.imag);
26337  #else
26338  return hypotf(z.real, z.imag);
26339  #endif
26340  }
26341  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_pow_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
26342  __pyx_t_float_complex z;
26343  float r, lnr, theta, z_r, z_theta;
26344  if (b.imag == 0 && b.real == (int)b.real) {
26345  if (b.real < 0) {
26346  float denom = a.real * a.real + a.imag * a.imag;
26347  a.real = a.real / denom;
26348  a.imag = -a.imag / denom;
26349  b.real = -b.real;
26350  }
26351  switch ((int)b.real) {
26352  case 0:
26353  z.real = 1;
26354  z.imag = 0;
26355  return z;
26356  case 1:
26357  return a;
26358  case 2:
26359  z = __Pyx_c_prod_float(a, a);
26360  return __Pyx_c_prod_float(a, a);
26361  case 3:
26362  z = __Pyx_c_prod_float(a, a);
26363  return __Pyx_c_prod_float(z, a);
26364  case 4:
26365  z = __Pyx_c_prod_float(a, a);
26366  return __Pyx_c_prod_float(z, z);
26367  }
26368  }
26369  if (a.imag == 0) {
26370  if (a.real == 0) {
26371  return a;
26372  } else if (b.imag == 0) {
26373  z.real = powf(a.real, b.real);
26374  z.imag = 0;
26375  return z;
26376  } else if (a.real > 0) {
26377  r = a.real;
26378  theta = 0;
26379  } else {
26380  r = -a.real;
26381  theta = atan2f(0, -1);
26382  }
26383  } else {
26384  r = __Pyx_c_abs_float(a);
26385  theta = atan2f(a.imag, a.real);
26386  }
26387  lnr = logf(r);
26388  z_r = expf(lnr * b.real - theta * b.imag);
26389  z_theta = theta * b.real + lnr * b.imag;
26390  z.real = z_r * cosf(z_theta);
26391  z.imag = z_r * sinf(z_theta);
26392  return z;
26393  }
26394  #endif
26395 #endif
26396 
26397 /* Declarations */
26398 #if CYTHON_CCOMPLEX
26399  #ifdef __cplusplus
26400  static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
26401  return ::std::complex< double >(x, y);
26402  }
26403  #else
26404  static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
26405  return x + y*(__pyx_t_double_complex)_Complex_I;
26406  }
26407  #endif
26408 #else
26409  static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
26410  __pyx_t_double_complex z;
26411  z.real = x;
26412  z.imag = y;
26413  return z;
26414  }
26415 #endif
26416 
26417 /* Arithmetic */
26418 #if CYTHON_CCOMPLEX
26419 #else
26420  static CYTHON_INLINE int __Pyx_c_eq_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
26421  return (a.real == b.real) && (a.imag == b.imag);
26422  }
26423  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
26424  __pyx_t_double_complex z;
26425  z.real = a.real + b.real;
26426  z.imag = a.imag + b.imag;
26427  return z;
26428  }
26429  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
26430  __pyx_t_double_complex z;
26431  z.real = a.real - b.real;
26432  z.imag = a.imag - b.imag;
26433  return z;
26434  }
26435  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
26436  __pyx_t_double_complex z;
26437  z.real = a.real * b.real - a.imag * b.imag;
26438  z.imag = a.real * b.imag + a.imag * b.real;
26439  return z;
26440  }
26441  #if 1
26442  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
26443  if (b.imag == 0) {
26444  return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.real);
26445  } else if (fabs(b.real) >= fabs(b.imag)) {
26446  if (b.real == 0 && b.imag == 0) {
26447  return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.imag);
26448  } else {
26449  double r = b.imag / b.real;
26450  double s = 1.0 / (b.real + b.imag * r);
26451  return __pyx_t_double_complex_from_parts(
26452  (a.real + a.imag * r) * s, (a.imag - a.real * r) * s);
26453  }
26454  } else {
26455  double r = b.real / b.imag;
26456  double s = 1.0 / (b.imag + b.real * r);
26457  return __pyx_t_double_complex_from_parts(
26458  (a.real * r + a.imag) * s, (a.imag * r - a.real) * s);
26459  }
26460  }
26461  #else
26462  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
26463  if (b.imag == 0) {
26464  return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.real);
26465  } else {
26466  double denom = b.real * b.real + b.imag * b.imag;
26467  return __pyx_t_double_complex_from_parts(
26468  (a.real * b.real + a.imag * b.imag) / denom,
26469  (a.imag * b.real - a.real * b.imag) / denom);
26470  }
26471  }
26472  #endif
26473  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg_double(__pyx_t_double_complex a) {
26474  __pyx_t_double_complex z;
26475  z.real = -a.real;
26476  z.imag = -a.imag;
26477  return z;
26478  }
26479  static CYTHON_INLINE int __Pyx_c_is_zero_double(__pyx_t_double_complex a) {
26480  return (a.real == 0) && (a.imag == 0);
26481  }
26482  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj_double(__pyx_t_double_complex a) {
26483  __pyx_t_double_complex z;
26484  z.real = a.real;
26485  z.imag = -a.imag;
26486  return z;
26487  }
26488  #if 1
26489  static CYTHON_INLINE double __Pyx_c_abs_double(__pyx_t_double_complex z) {
26490  #if !defined(HAVE_HYPOT) || defined(_MSC_VER)
26491  return sqrt(z.real*z.real + z.imag*z.imag);
26492  #else
26493  return hypot(z.real, z.imag);
26494  #endif
26495  }
26496  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
26497  __pyx_t_double_complex z;
26498  double r, lnr, theta, z_r, z_theta;
26499  if (b.imag == 0 && b.real == (int)b.real) {
26500  if (b.real < 0) {
26501  double denom = a.real * a.real + a.imag * a.imag;
26502  a.real = a.real / denom;
26503  a.imag = -a.imag / denom;
26504  b.real = -b.real;
26505  }
26506  switch ((int)b.real) {
26507  case 0:
26508  z.real = 1;
26509  z.imag = 0;
26510  return z;
26511  case 1:
26512  return a;
26513  case 2:
26514  z = __Pyx_c_prod_double(a, a);
26515  return __Pyx_c_prod_double(a, a);
26516  case 3:
26517  z = __Pyx_c_prod_double(a, a);
26518  return __Pyx_c_prod_double(z, a);
26519  case 4:
26520  z = __Pyx_c_prod_double(a, a);
26521  return __Pyx_c_prod_double(z, z);
26522  }
26523  }
26524  if (a.imag == 0) {
26525  if (a.real == 0) {
26526  return a;
26527  } else if (b.imag == 0) {
26528  z.real = pow(a.real, b.real);
26529  z.imag = 0;
26530  return z;
26531  } else if (a.real > 0) {
26532  r = a.real;
26533  theta = 0;
26534  } else {
26535  r = -a.real;
26536  theta = atan2(0, -1);
26537  }
26538  } else {
26539  r = __Pyx_c_abs_double(a);
26540  theta = atan2(a.imag, a.real);
26541  }
26542  lnr = log(r);
26543  z_r = exp(lnr * b.real - theta * b.imag);
26544  z_theta = theta * b.real + lnr * b.imag;
26545  z.real = z_r * cos(z_theta);
26546  z.imag = z_r * sin(z_theta);
26547  return z;
26548  }
26549  #endif
26550 #endif
26551 
26552 /* CIntToPy */
26553 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum__NPY_TYPES(enum NPY_TYPES value) {
26554  const enum NPY_TYPES neg_one = (enum NPY_TYPES) ((enum NPY_TYPES) 0 - (enum NPY_TYPES) 1), const_zero = (enum NPY_TYPES) 0;
26555  const int is_unsigned = neg_one > const_zero;
26556  if (is_unsigned) {
26557  if (sizeof(enum NPY_TYPES) < sizeof(long)) {
26558  return PyInt_FromLong((long) value);
26559  } else if (sizeof(enum NPY_TYPES) <= sizeof(unsigned long)) {
26560  return PyLong_FromUnsignedLong((unsigned long) value);
26561 #ifdef HAVE_LONG_LONG
26562  } else if (sizeof(enum NPY_TYPES) <= sizeof(unsigned PY_LONG_LONG)) {
26563  return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
26564 #endif
26565  }
26566  } else {
26567  if (sizeof(enum NPY_TYPES) <= sizeof(long)) {
26568  return PyInt_FromLong((long) value);
26569 #ifdef HAVE_LONG_LONG
26570  } else if (sizeof(enum NPY_TYPES) <= sizeof(PY_LONG_LONG)) {
26571  return PyLong_FromLongLong((PY_LONG_LONG) value);
26572 #endif
26573  }
26574  }
26575  {
26576  int one = 1; int little = (int)*(unsigned char *)&one;
26577  unsigned char *bytes = (unsigned char *)&value;
26578  return _PyLong_FromByteArray(bytes, sizeof(enum NPY_TYPES),
26579  little, !is_unsigned);
26580  }
26581 }
26582 
26583 #if PY_MAJOR_VERSION < 3
26584 static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view, int flags) {
26585  if (PyObject_CheckBuffer(obj)) return PyObject_GetBuffer(obj, view, flags);
26586  if (__Pyx_TypeCheck(obj, __pyx_ptype_5numpy_ndarray)) return __pyx_pw_5numpy_7ndarray_1__getbuffer__(obj, view, flags);
26587  if (__Pyx_TypeCheck(obj, __pyx_array_type)) return __pyx_array_getbuffer(obj, view, flags);
26588  if (__Pyx_TypeCheck(obj, __pyx_memoryview_type)) return __pyx_memoryview_getbuffer(obj, view, flags);
26589  PyErr_Format(PyExc_TypeError, "'%.200s' does not have the buffer interface", Py_TYPE(obj)->tp_name);
26590  return -1;
26591 }
26592 static void __Pyx_ReleaseBuffer(Py_buffer *view) {
26593  PyObject *obj = view->obj;
26594  if (!obj) return;
26595  if (PyObject_CheckBuffer(obj)) {
26596  PyBuffer_Release(view);
26597  return;
26598  }
26599  if ((0)) {}
26600  else if (__Pyx_TypeCheck(obj, __pyx_ptype_5numpy_ndarray)) __pyx_pw_5numpy_7ndarray_3__releasebuffer__(obj, view);
26601  view->obj = NULL;
26602  Py_DECREF(obj);
26603 }
26604 #endif
26605 
26606 
26607 /* MemviewSliceIsContig */
26608 static int
26609 __pyx_memviewslice_is_contig(const __Pyx_memviewslice mvs, char order, int ndim)
26610 {
26611  int i, index, step, start;
26612  Py_ssize_t itemsize = mvs.memview->view.itemsize;
26613  if (order == 'F') {
26614  step = 1;
26615  start = 0;
26616  } else {
26617  step = -1;
26618  start = ndim - 1;
26619  }
26620  for (i = 0; i < ndim; i++) {
26621  index = start + step * i;
26622  if (mvs.suboffsets[index] >= 0 || mvs.strides[index] != itemsize)
26623  return 0;
26624  itemsize *= mvs.shape[index];
26625  }
26626  return 1;
26627 }
26628 
26629 /* OverlappingSlices */
26630 static void
26631 __pyx_get_array_memory_extents(__Pyx_memviewslice *slice,
26632  void **out_start, void **out_end,
26633  int ndim, size_t itemsize)
26634 {
26635  char *start, *end;
26636  int i;
26637  start = end = slice->data;
26638  for (i = 0; i < ndim; i++) {
26639  Py_ssize_t stride = slice->strides[i];
26640  Py_ssize_t extent = slice->shape[i];
26641  if (extent == 0) {
26642  *out_start = *out_end = start;
26643  return;
26644  } else {
26645  if (stride > 0)
26646  end += stride * (extent - 1);
26647  else
26648  start += stride * (extent - 1);
26649  }
26650  }
26651  *out_start = start;
26652  *out_end = end + itemsize;
26653 }
26654 static int
26655 __pyx_slices_overlap(__Pyx_memviewslice *slice1,
26656  __Pyx_memviewslice *slice2,
26657  int ndim, size_t itemsize)
26658 {
26659  void *start1, *end1, *start2, *end2;
26660  __pyx_get_array_memory_extents(slice1, &start1, &end1, ndim, itemsize);
26661  __pyx_get_array_memory_extents(slice2, &start2, &end2, ndim, itemsize);
26662  return (start1 < end2) && (start2 < end1);
26663 }
26664 
26665 /* Capsule */
26666 static CYTHON_INLINE PyObject *
26667 __pyx_capsule_create(void *p, CYTHON_UNUSED const char *sig)
26668 {
26669  PyObject *cobj;
26670 #if PY_VERSION_HEX >= 0x02070000
26671  cobj = PyCapsule_New(p, sig, NULL);
26672 #else
26673  cobj = PyCObject_FromVoidPtr(p, NULL);
26674 #endif
26675  return cobj;
26676 }
26677 
26678 /* CIntFromPy */
26679 static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) {
26680  const int neg_one = (int) ((int) 0 - (int) 1), const_zero = (int) 0;
26681  const int is_unsigned = neg_one > const_zero;
26682 #if PY_MAJOR_VERSION < 3
26683  if (likely(PyInt_Check(x))) {
26684  if (sizeof(int) < sizeof(long)) {
26685  __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x))
26686  } else {
26687  long val = PyInt_AS_LONG(x);
26688  if (is_unsigned && unlikely(val < 0)) {
26689  goto raise_neg_overflow;
26690  }
26691  return (int) val;
26692  }
26693  } else
26694 #endif
26695  if (likely(PyLong_Check(x))) {
26696  if (is_unsigned) {
26697 #if CYTHON_USE_PYLONG_INTERNALS
26698  const digit* digits = ((PyLongObject*)x)->ob_digit;
26699  switch (Py_SIZE(x)) {
26700  case 0: return (int) 0;
26701  case 1: __PYX_VERIFY_RETURN_INT(int, digit, digits[0])
26702  case 2:
26703  if (8 * sizeof(int) > 1 * PyLong_SHIFT) {
26704  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
26705  __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
26706  } else if (8 * sizeof(int) >= 2 * PyLong_SHIFT) {
26707  return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
26708  }
26709  }
26710  break;
26711  case 3:
26712  if (8 * sizeof(int) > 2 * PyLong_SHIFT) {
26713  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
26714  __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
26715  } else if (8 * sizeof(int) >= 3 * PyLong_SHIFT) {
26716  return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
26717  }
26718  }
26719  break;
26720  case 4:
26721  if (8 * sizeof(int) > 3 * PyLong_SHIFT) {
26722  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
26723  __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
26724  } else if (8 * sizeof(int) >= 4 * PyLong_SHIFT) {
26725  return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
26726  }
26727  }
26728  break;
26729  }
26730 #endif
26731 #if CYTHON_COMPILING_IN_CPYTHON
26732  if (unlikely(Py_SIZE(x) < 0)) {
26733  goto raise_neg_overflow;
26734  }
26735 #else
26736  {
26737  int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
26738  if (unlikely(result < 0))
26739  return (int) -1;
26740  if (unlikely(result == 1))
26741  goto raise_neg_overflow;
26742  }
26743 #endif
26744  if (sizeof(int) <= sizeof(unsigned long)) {
26745  __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x))
26746 #ifdef HAVE_LONG_LONG
26747  } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) {
26748  __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
26749 #endif
26750  }
26751  } else {
26752 #if CYTHON_USE_PYLONG_INTERNALS
26753  const digit* digits = ((PyLongObject*)x)->ob_digit;
26754  switch (Py_SIZE(x)) {
26755  case 0: return (int) 0;
26756  case -1: __PYX_VERIFY_RETURN_INT(int, sdigit, (sdigit) (-(sdigit)digits[0]))
26757  case 1: __PYX_VERIFY_RETURN_INT(int, digit, +digits[0])
26758  case -2:
26759  if (8 * sizeof(int) - 1 > 1 * PyLong_SHIFT) {
26760  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
26761  __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
26762  } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
26763  return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
26764  }
26765  }
26766  break;
26767  case 2:
26768  if (8 * sizeof(int) > 1 * PyLong_SHIFT) {
26769  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
26770  __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
26771  } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
26772  return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
26773  }
26774  }
26775  break;
26776  case -3:
26777  if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
26778  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
26779  __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
26780  } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
26781  return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
26782  }
26783  }
26784  break;
26785  case 3:
26786  if (8 * sizeof(int) > 2 * PyLong_SHIFT) {
26787  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
26788  __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
26789  } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
26790  return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
26791  }
26792  }
26793  break;
26794  case -4:
26795  if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
26796  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
26797  __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
26798  } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) {
26799  return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
26800  }
26801  }
26802  break;
26803  case 4:
26804  if (8 * sizeof(int) > 3 * PyLong_SHIFT) {
26805  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
26806  __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
26807  } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) {
26808  return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
26809  }
26810  }
26811  break;
26812  }
26813 #endif
26814  if (sizeof(int) <= sizeof(long)) {
26815  __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x))
26816 #ifdef HAVE_LONG_LONG
26817  } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) {
26818  __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x))
26819 #endif
26820  }
26821  }
26822  {
26823 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
26824  PyErr_SetString(PyExc_RuntimeError,
26825  "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
26826 #else
26827  int val;
26828  PyObject *v = __Pyx_PyNumber_IntOrLong(x);
26829  #if PY_MAJOR_VERSION < 3
26830  if (likely(v) && !PyLong_Check(v)) {
26831  PyObject *tmp = v;
26832  v = PyNumber_Long(tmp);
26833  Py_DECREF(tmp);
26834  }
26835  #endif
26836  if (likely(v)) {
26837  int one = 1; int is_little = (int)*(unsigned char *)&one;
26838  unsigned char *bytes = (unsigned char *)&val;
26839  int ret = _PyLong_AsByteArray((PyLongObject *)v,
26840  bytes, sizeof(val),
26841  is_little, !is_unsigned);
26842  Py_DECREF(v);
26843  if (likely(!ret))
26844  return val;
26845  }
26846 #endif
26847  return (int) -1;
26848  }
26849  } else {
26850  int val;
26851  PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
26852  if (!tmp) return (int) -1;
26853  val = __Pyx_PyInt_As_int(tmp);
26854  Py_DECREF(tmp);
26855  return val;
26856  }
26857 raise_overflow:
26858  PyErr_SetString(PyExc_OverflowError,
26859  "value too large to convert to int");
26860  return (int) -1;
26861 raise_neg_overflow:
26862  PyErr_SetString(PyExc_OverflowError,
26863  "can't convert negative value to int");
26864  return (int) -1;
26865 }
26866 
26867 /* TypeInfoToFormat */
26868 static struct __pyx_typeinfo_string __Pyx_TypeInfoToFormat(__Pyx_TypeInfo *type) {
26869  struct __pyx_typeinfo_string result = { {0} };
26870  char *buf = (char *) result.string;
26871  size_t size = type->size;
26872  switch (type->typegroup) {
26873  case 'H':
26874  *buf = 'c';
26875  break;
26876  case 'I':
26877  case 'U':
26878  if (size == 1)
26879  *buf = (type->is_unsigned) ? 'B' : 'b';
26880  else if (size == 2)
26881  *buf = (type->is_unsigned) ? 'H' : 'h';
26882  else if (size == 4)
26883  *buf = (type->is_unsigned) ? 'I' : 'i';
26884  else if (size == 8)
26885  *buf = (type->is_unsigned) ? 'Q' : 'q';
26886  break;
26887  case 'P':
26888  *buf = 'P';
26889  break;
26890  case 'C':
26891  {
26892  __Pyx_TypeInfo complex_type = *type;
26893  complex_type.typegroup = 'R';
26894  complex_type.size /= 2;
26895  *buf++ = 'Z';
26896  *buf = __Pyx_TypeInfoToFormat(&complex_type).string[0];
26897  break;
26898  }
26899  case 'R':
26900  if (size == 4)
26901  *buf = 'f';
26902  else if (size == 8)
26903  *buf = 'd';
26904  else
26905  *buf = 'g';
26906  break;
26907  }
26908  return result;
26909 }
26910 
26911 /* MemviewSliceCopyTemplate */
26912 static __Pyx_memviewslice
26913 __pyx_memoryview_copy_new_contig(const __Pyx_memviewslice *from_mvs,
26914  const char *mode, int ndim,
26915  size_t sizeof_dtype, int contig_flag,
26916  int dtype_is_object)
26917 {
26918  __Pyx_RefNannyDeclarations
26919  int i;
26920  __Pyx_memviewslice new_mvs = { 0, 0, { 0 }, { 0 }, { 0 } };
26921  struct __pyx_memoryview_obj *from_memview = from_mvs->memview;
26922  Py_buffer *buf = &from_memview->view;
26923  PyObject *shape_tuple = NULL;
26924  PyObject *temp_int = NULL;
26925  struct __pyx_array_obj *array_obj = NULL;
26926  struct __pyx_memoryview_obj *memview_obj = NULL;
26927  __Pyx_RefNannySetupContext("__pyx_memoryview_copy_new_contig", 0);
26928  for (i = 0; i < ndim; i++) {
26929  if (from_mvs->suboffsets[i] >= 0) {
26930  PyErr_Format(PyExc_ValueError, "Cannot copy memoryview slice with "
26931  "indirect dimensions (axis %d)", i);
26932  goto fail;
26933  }
26934  }
26935  shape_tuple = PyTuple_New(ndim);
26936  if (unlikely(!shape_tuple)) {
26937  goto fail;
26938  }
26939  __Pyx_GOTREF(shape_tuple);
26940  for(i = 0; i < ndim; i++) {
26941  temp_int = PyInt_FromSsize_t(from_mvs->shape[i]);
26942  if(unlikely(!temp_int)) {
26943  goto fail;
26944  } else {
26945  PyTuple_SET_ITEM(shape_tuple, i, temp_int);
26946  temp_int = NULL;
26947  }
26948  }
26949  array_obj = __pyx_array_new(shape_tuple, sizeof_dtype, buf->format, (char *) mode, NULL);
26950  if (unlikely(!array_obj)) {
26951  goto fail;
26952  }
26953  __Pyx_GOTREF(array_obj);
26954  memview_obj = (struct __pyx_memoryview_obj *) __pyx_memoryview_new(
26955  (PyObject *) array_obj, contig_flag,
26956  dtype_is_object,
26957  from_mvs->memview->typeinfo);
26958  if (unlikely(!memview_obj))
26959  goto fail;
26960  if (unlikely(__Pyx_init_memviewslice(memview_obj, ndim, &new_mvs, 1) < 0))
26961  goto fail;
26962  if (unlikely(__pyx_memoryview_copy_contents(*from_mvs, new_mvs, ndim, ndim,
26963  dtype_is_object) < 0))
26964  goto fail;
26965  goto no_fail;
26966 fail:
26967  __Pyx_XDECREF(new_mvs.memview);
26968  new_mvs.memview = NULL;
26969  new_mvs.data = NULL;
26970 no_fail:
26971  __Pyx_XDECREF(shape_tuple);
26972  __Pyx_XDECREF(temp_int);
26973  __Pyx_XDECREF(array_obj);
26974  __Pyx_RefNannyFinishContext();
26975  return new_mvs;
26976 }
26977 
26978 /* MemviewSliceInit */
26979 static int
26980 __Pyx_init_memviewslice(struct __pyx_memoryview_obj *memview,
26981  int ndim,
26982  __Pyx_memviewslice *memviewslice,
26983  int memview_is_new_reference)
26984 {
26985  __Pyx_RefNannyDeclarations
26986  int i, retval=-1;
26987  Py_buffer *buf = &memview->view;
26988  __Pyx_RefNannySetupContext("init_memviewslice", 0);
26989  if (!buf) {
26990  PyErr_SetString(PyExc_ValueError,
26991  "buf is NULL.");
26992  goto fail;
26993  } else if (memviewslice->memview || memviewslice->data) {
26994  PyErr_SetString(PyExc_ValueError,
26995  "memviewslice is already initialized!");
26996  goto fail;
26997  }
26998  if (buf->strides) {
26999  for (i = 0; i < ndim; i++) {
27000  memviewslice->strides[i] = buf->strides[i];
27001  }
27002  } else {
27003  Py_ssize_t stride = buf->itemsize;
27004  for (i = ndim - 1; i >= 0; i--) {
27005  memviewslice->strides[i] = stride;
27006  stride *= buf->shape[i];
27007  }
27008  }
27009  for (i = 0; i < ndim; i++) {
27010  memviewslice->shape[i] = buf->shape[i];
27011  if (buf->suboffsets) {
27012  memviewslice->suboffsets[i] = buf->suboffsets[i];
27013  } else {
27014  memviewslice->suboffsets[i] = -1;
27015  }
27016  }
27017  memviewslice->memview = memview;
27018  memviewslice->data = (char *)buf->buf;
27019  if (__pyx_add_acquisition_count(memview) == 0 && !memview_is_new_reference) {
27020  Py_INCREF(memview);
27021  }
27022  retval = 0;
27023  goto no_fail;
27024 fail:
27025  memviewslice->memview = 0;
27026  memviewslice->data = 0;
27027  retval = -1;
27028 no_fail:
27029  __Pyx_RefNannyFinishContext();
27030  return retval;
27031 }
27032 #ifndef Py_NO_RETURN
27033 #define Py_NO_RETURN
27034 #endif
27035 static void __pyx_fatalerror(const char *fmt, ...) Py_NO_RETURN {
27036  va_list vargs;
27037  char msg[200];
27038 #ifdef HAVE_STDARG_PROTOTYPES
27039  va_start(vargs, fmt);
27040 #else
27041  va_start(vargs);
27042 #endif
27043  vsnprintf(msg, 200, fmt, vargs);
27044  va_end(vargs);
27045  Py_FatalError(msg);
27046 }
27047 static CYTHON_INLINE int
27048 __pyx_add_acquisition_count_locked(__pyx_atomic_int *acquisition_count,
27049  PyThread_type_lock lock)
27050 {
27051  int result;
27052  PyThread_acquire_lock(lock, 1);
27053  result = (*acquisition_count)++;
27054  PyThread_release_lock(lock);
27055  return result;
27056 }
27057 static CYTHON_INLINE int
27058 __pyx_sub_acquisition_count_locked(__pyx_atomic_int *acquisition_count,
27059  PyThread_type_lock lock)
27060 {
27061  int result;
27062  PyThread_acquire_lock(lock, 1);
27063  result = (*acquisition_count)--;
27064  PyThread_release_lock(lock);
27065  return result;
27066 }
27067 static CYTHON_INLINE void
27068 __Pyx_INC_MEMVIEW(__Pyx_memviewslice *memslice, int have_gil, int lineno)
27069 {
27070  int first_time;
27071  struct __pyx_memoryview_obj *memview = memslice->memview;
27072  if (!memview || (PyObject *) memview == Py_None)
27073  return;
27074  if (__pyx_get_slice_count(memview) < 0)
27075  __pyx_fatalerror("Acquisition count is %d (line %d)",
27076  __pyx_get_slice_count(memview), lineno);
27077  first_time = __pyx_add_acquisition_count(memview) == 0;
27078  if (first_time) {
27079  if (have_gil) {
27080  Py_INCREF((PyObject *) memview);
27081  } else {
27082  PyGILState_STATE _gilstate = PyGILState_Ensure();
27083  Py_INCREF((PyObject *) memview);
27084  PyGILState_Release(_gilstate);
27085  }
27086  }
27087 }
27088 static CYTHON_INLINE void __Pyx_XDEC_MEMVIEW(__Pyx_memviewslice *memslice,
27089  int have_gil, int lineno) {
27090  int last_time;
27091  struct __pyx_memoryview_obj *memview = memslice->memview;
27092  if (!memview ) {
27093  return;
27094  } else if ((PyObject *) memview == Py_None) {
27095  memslice->memview = NULL;
27096  return;
27097  }
27098  if (__pyx_get_slice_count(memview) <= 0)
27099  __pyx_fatalerror("Acquisition count is %d (line %d)",
27100  __pyx_get_slice_count(memview), lineno);
27101  last_time = __pyx_sub_acquisition_count(memview) == 1;
27102  memslice->data = NULL;
27103  if (last_time) {
27104  if (have_gil) {
27105  Py_CLEAR(memslice->memview);
27106  } else {
27107  PyGILState_STATE _gilstate = PyGILState_Ensure();
27108  Py_CLEAR(memslice->memview);
27109  PyGILState_Release(_gilstate);
27110  }
27111  } else {
27112  memslice->memview = NULL;
27113  }
27114 }
27115 
27116 /* CIntFromPy */
27117 static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) {
27118  const long neg_one = (long) ((long) 0 - (long) 1), const_zero = (long) 0;
27119  const int is_unsigned = neg_one > const_zero;
27120 #if PY_MAJOR_VERSION < 3
27121  if (likely(PyInt_Check(x))) {
27122  if (sizeof(long) < sizeof(long)) {
27123  __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x))
27124  } else {
27125  long val = PyInt_AS_LONG(x);
27126  if (is_unsigned && unlikely(val < 0)) {
27127  goto raise_neg_overflow;
27128  }
27129  return (long) val;
27130  }
27131  } else
27132 #endif
27133  if (likely(PyLong_Check(x))) {
27134  if (is_unsigned) {
27135 #if CYTHON_USE_PYLONG_INTERNALS
27136  const digit* digits = ((PyLongObject*)x)->ob_digit;
27137  switch (Py_SIZE(x)) {
27138  case 0: return (long) 0;
27139  case 1: __PYX_VERIFY_RETURN_INT(long, digit, digits[0])
27140  case 2:
27141  if (8 * sizeof(long) > 1 * PyLong_SHIFT) {
27142  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
27143  __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
27144  } else if (8 * sizeof(long) >= 2 * PyLong_SHIFT) {
27145  return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
27146  }
27147  }
27148  break;
27149  case 3:
27150  if (8 * sizeof(long) > 2 * PyLong_SHIFT) {
27151  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
27152  __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
27153  } else if (8 * sizeof(long) >= 3 * PyLong_SHIFT) {
27154  return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
27155  }
27156  }
27157  break;
27158  case 4:
27159  if (8 * sizeof(long) > 3 * PyLong_SHIFT) {
27160  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
27161  __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
27162  } else if (8 * sizeof(long) >= 4 * PyLong_SHIFT) {
27163  return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
27164  }
27165  }
27166  break;
27167  }
27168 #endif
27169 #if CYTHON_COMPILING_IN_CPYTHON
27170  if (unlikely(Py_SIZE(x) < 0)) {
27171  goto raise_neg_overflow;
27172  }
27173 #else
27174  {
27175  int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
27176  if (unlikely(result < 0))
27177  return (long) -1;
27178  if (unlikely(result == 1))
27179  goto raise_neg_overflow;
27180  }
27181 #endif
27182  if (sizeof(long) <= sizeof(unsigned long)) {
27183  __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x))
27184 #ifdef HAVE_LONG_LONG
27185  } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {
27186  __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
27187 #endif
27188  }
27189  } else {
27190 #if CYTHON_USE_PYLONG_INTERNALS
27191  const digit* digits = ((PyLongObject*)x)->ob_digit;
27192  switch (Py_SIZE(x)) {
27193  case 0: return (long) 0;
27194  case -1: __PYX_VERIFY_RETURN_INT(long, sdigit, (sdigit) (-(sdigit)digits[0]))
27195  case 1: __PYX_VERIFY_RETURN_INT(long, digit, +digits[0])
27196  case -2:
27197  if (8 * sizeof(long) - 1 > 1 * PyLong_SHIFT) {
27198  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
27199  __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
27200  } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
27201  return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
27202  }
27203  }
27204  break;
27205  case 2:
27206  if (8 * sizeof(long) > 1 * PyLong_SHIFT) {
27207  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
27208  __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
27209  } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
27210  return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
27211  }
27212  }
27213  break;
27214  case -3:
27215  if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
27216  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
27217  __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
27218  } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
27219  return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
27220  }
27221  }
27222  break;
27223  case 3:
27224  if (8 * sizeof(long) > 2 * PyLong_SHIFT) {
27225  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
27226  __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
27227  } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
27228  return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
27229  }
27230  }
27231  break;
27232  case -4:
27233  if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
27234  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
27235  __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
27236  } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
27237  return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
27238  }
27239  }
27240  break;
27241  case 4:
27242  if (8 * sizeof(long) > 3 * PyLong_SHIFT) {
27243  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
27244  __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
27245  } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
27246  return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
27247  }
27248  }
27249  break;
27250  }
27251 #endif
27252  if (sizeof(long) <= sizeof(long)) {
27253  __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x))
27254 #ifdef HAVE_LONG_LONG
27255  } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
27256  __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x))
27257 #endif
27258  }
27259  }
27260  {
27261 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
27262  PyErr_SetString(PyExc_RuntimeError,
27263  "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
27264 #else
27265  long val;
27266  PyObject *v = __Pyx_PyNumber_IntOrLong(x);
27267  #if PY_MAJOR_VERSION < 3
27268  if (likely(v) && !PyLong_Check(v)) {
27269  PyObject *tmp = v;
27270  v = PyNumber_Long(tmp);
27271  Py_DECREF(tmp);
27272  }
27273  #endif
27274  if (likely(v)) {
27275  int one = 1; int is_little = (int)*(unsigned char *)&one;
27276  unsigned char *bytes = (unsigned char *)&val;
27277  int ret = _PyLong_AsByteArray((PyLongObject *)v,
27278  bytes, sizeof(val),
27279  is_little, !is_unsigned);
27280  Py_DECREF(v);
27281  if (likely(!ret))
27282  return val;
27283  }
27284 #endif
27285  return (long) -1;
27286  }
27287  } else {
27288  long val;
27289  PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
27290  if (!tmp) return (long) -1;
27291  val = __Pyx_PyInt_As_long(tmp);
27292  Py_DECREF(tmp);
27293  return val;
27294  }
27295 raise_overflow:
27296  PyErr_SetString(PyExc_OverflowError,
27297  "value too large to convert to long");
27298  return (long) -1;
27299 raise_neg_overflow:
27300  PyErr_SetString(PyExc_OverflowError,
27301  "can't convert negative value to long");
27302  return (long) -1;
27303 }
27304 
27305 /* CIntToPy */
27306 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) {
27307  const long neg_one = (long) ((long) 0 - (long) 1), const_zero = (long) 0;
27308  const int is_unsigned = neg_one > const_zero;
27309  if (is_unsigned) {
27310  if (sizeof(long) < sizeof(long)) {
27311  return PyInt_FromLong((long) value);
27312  } else if (sizeof(long) <= sizeof(unsigned long)) {
27313  return PyLong_FromUnsignedLong((unsigned long) value);
27314 #ifdef HAVE_LONG_LONG
27315  } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {
27316  return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
27317 #endif
27318  }
27319  } else {
27320  if (sizeof(long) <= sizeof(long)) {
27321  return PyInt_FromLong((long) value);
27322 #ifdef HAVE_LONG_LONG
27323  } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
27324  return PyLong_FromLongLong((PY_LONG_LONG) value);
27325 #endif
27326  }
27327  }
27328  {
27329  int one = 1; int little = (int)*(unsigned char *)&one;
27330  unsigned char *bytes = (unsigned char *)&value;
27331  return _PyLong_FromByteArray(bytes, sizeof(long),
27332  little, !is_unsigned);
27333  }
27334 }
27335 
27336 /* CIntFromPy */
27337 static CYTHON_INLINE char __Pyx_PyInt_As_char(PyObject *x) {
27338  const char neg_one = (char) ((char) 0 - (char) 1), const_zero = (char) 0;
27339  const int is_unsigned = neg_one > const_zero;
27340 #if PY_MAJOR_VERSION < 3
27341  if (likely(PyInt_Check(x))) {
27342  if (sizeof(char) < sizeof(long)) {
27343  __PYX_VERIFY_RETURN_INT(char, long, PyInt_AS_LONG(x))
27344  } else {
27345  long val = PyInt_AS_LONG(x);
27346  if (is_unsigned && unlikely(val < 0)) {
27347  goto raise_neg_overflow;
27348  }
27349  return (char) val;
27350  }
27351  } else
27352 #endif
27353  if (likely(PyLong_Check(x))) {
27354  if (is_unsigned) {
27355 #if CYTHON_USE_PYLONG_INTERNALS
27356  const digit* digits = ((PyLongObject*)x)->ob_digit;
27357  switch (Py_SIZE(x)) {
27358  case 0: return (char) 0;
27359  case 1: __PYX_VERIFY_RETURN_INT(char, digit, digits[0])
27360  case 2:
27361  if (8 * sizeof(char) > 1 * PyLong_SHIFT) {
27362  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
27363  __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
27364  } else if (8 * sizeof(char) >= 2 * PyLong_SHIFT) {
27365  return (char) (((((char)digits[1]) << PyLong_SHIFT) | (char)digits[0]));
27366  }
27367  }
27368  break;
27369  case 3:
27370  if (8 * sizeof(char) > 2 * PyLong_SHIFT) {
27371  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
27372  __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
27373  } else if (8 * sizeof(char) >= 3 * PyLong_SHIFT) {
27374  return (char) (((((((char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0]));
27375  }
27376  }
27377  break;
27378  case 4:
27379  if (8 * sizeof(char) > 3 * PyLong_SHIFT) {
27380  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
27381  __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
27382  } else if (8 * sizeof(char) >= 4 * PyLong_SHIFT) {
27383  return (char) (((((((((char)digits[3]) << PyLong_SHIFT) | (char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0]));
27384  }
27385  }
27386  break;
27387  }
27388 #endif
27389 #if CYTHON_COMPILING_IN_CPYTHON
27390  if (unlikely(Py_SIZE(x) < 0)) {
27391  goto raise_neg_overflow;
27392  }
27393 #else
27394  {
27395  int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
27396  if (unlikely(result < 0))
27397  return (char) -1;
27398  if (unlikely(result == 1))
27399  goto raise_neg_overflow;
27400  }
27401 #endif
27402  if (sizeof(char) <= sizeof(unsigned long)) {
27403  __PYX_VERIFY_RETURN_INT_EXC(char, unsigned long, PyLong_AsUnsignedLong(x))
27404 #ifdef HAVE_LONG_LONG
27405  } else if (sizeof(char) <= sizeof(unsigned PY_LONG_LONG)) {
27406  __PYX_VERIFY_RETURN_INT_EXC(char, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
27407 #endif
27408  }
27409  } else {
27410 #if CYTHON_USE_PYLONG_INTERNALS
27411  const digit* digits = ((PyLongObject*)x)->ob_digit;
27412  switch (Py_SIZE(x)) {
27413  case 0: return (char) 0;
27414  case -1: __PYX_VERIFY_RETURN_INT(char, sdigit, (sdigit) (-(sdigit)digits[0]))
27415  case 1: __PYX_VERIFY_RETURN_INT(char, digit, +digits[0])
27416  case -2:
27417  if (8 * sizeof(char) - 1 > 1 * PyLong_SHIFT) {
27418  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
27419  __PYX_VERIFY_RETURN_INT(char, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
27420  } else if (8 * sizeof(char) - 1 > 2 * PyLong_SHIFT) {
27421  return (char) (((char)-1)*(((((char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
27422  }
27423  }
27424  break;
27425  case 2:
27426  if (8 * sizeof(char) > 1 * PyLong_SHIFT) {
27427  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
27428  __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
27429  } else if (8 * sizeof(char) - 1 > 2 * PyLong_SHIFT) {
27430  return (char) ((((((char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
27431  }
27432  }
27433  break;
27434  case -3:
27435  if (8 * sizeof(char) - 1 > 2 * PyLong_SHIFT) {
27436  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
27437  __PYX_VERIFY_RETURN_INT(char, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
27438  } else if (8 * sizeof(char) - 1 > 3 * PyLong_SHIFT) {
27439  return (char) (((char)-1)*(((((((char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
27440  }
27441  }
27442  break;
27443  case 3:
27444  if (8 * sizeof(char) > 2 * PyLong_SHIFT) {
27445  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
27446  __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
27447  } else if (8 * sizeof(char) - 1 > 3 * PyLong_SHIFT) {
27448  return (char) ((((((((char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
27449  }
27450  }
27451  break;
27452  case -4:
27453  if (8 * sizeof(char) - 1 > 3 * PyLong_SHIFT) {
27454  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
27455  __PYX_VERIFY_RETURN_INT(char, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
27456  } else if (8 * sizeof(char) - 1 > 4 * PyLong_SHIFT) {
27457  return (char) (((char)-1)*(((((((((char)digits[3]) << PyLong_SHIFT) | (char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
27458  }
27459  }
27460  break;
27461  case 4:
27462  if (8 * sizeof(char) > 3 * PyLong_SHIFT) {
27463  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
27464  __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
27465  } else if (8 * sizeof(char) - 1 > 4 * PyLong_SHIFT) {
27466  return (char) ((((((((((char)digits[3]) << PyLong_SHIFT) | (char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
27467  }
27468  }
27469  break;
27470  }
27471 #endif
27472  if (sizeof(char) <= sizeof(long)) {
27473  __PYX_VERIFY_RETURN_INT_EXC(char, long, PyLong_AsLong(x))
27474 #ifdef HAVE_LONG_LONG
27475  } else if (sizeof(char) <= sizeof(PY_LONG_LONG)) {
27476  __PYX_VERIFY_RETURN_INT_EXC(char, PY_LONG_LONG, PyLong_AsLongLong(x))
27477 #endif
27478  }
27479  }
27480  {
27481 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
27482  PyErr_SetString(PyExc_RuntimeError,
27483  "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
27484 #else
27485  char val;
27486  PyObject *v = __Pyx_PyNumber_IntOrLong(x);
27487  #if PY_MAJOR_VERSION < 3
27488  if (likely(v) && !PyLong_Check(v)) {
27489  PyObject *tmp = v;
27490  v = PyNumber_Long(tmp);
27491  Py_DECREF(tmp);
27492  }
27493  #endif
27494  if (likely(v)) {
27495  int one = 1; int is_little = (int)*(unsigned char *)&one;
27496  unsigned char *bytes = (unsigned char *)&val;
27497  int ret = _PyLong_AsByteArray((PyLongObject *)v,
27498  bytes, sizeof(val),
27499  is_little, !is_unsigned);
27500  Py_DECREF(v);
27501  if (likely(!ret))
27502  return val;
27503  }
27504 #endif
27505  return (char) -1;
27506  }
27507  } else {
27508  char val;
27509  PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
27510  if (!tmp) return (char) -1;
27511  val = __Pyx_PyInt_As_char(tmp);
27512  Py_DECREF(tmp);
27513  return val;
27514  }
27515 raise_overflow:
27516  PyErr_SetString(PyExc_OverflowError,
27517  "value too large to convert to char");
27518  return (char) -1;
27519 raise_neg_overflow:
27520  PyErr_SetString(PyExc_OverflowError,
27521  "can't convert negative value to char");
27522  return (char) -1;
27523 }
27524 
27525 /* CheckBinaryVersion */
27526 static int __Pyx_check_binary_version(void) {
27527  char ctversion[4], rtversion[4];
27528  PyOS_snprintf(ctversion, 4, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION);
27529  PyOS_snprintf(rtversion, 4, "%s", Py_GetVersion());
27530  if (ctversion[0] != rtversion[0] || ctversion[2] != rtversion[2]) {
27531  char message[200];
27532  PyOS_snprintf(message, sizeof(message),
27533  "compiletime version %s of module '%.100s' "
27534  "does not match runtime version %s",
27535  ctversion, __Pyx_MODULE_NAME, rtversion);
27536  return PyErr_WarnEx(NULL, message, 1);
27537  }
27538  return 0;
27539 }
27540 
27541 /* InitStrings */
27542 static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
27543  while (t->p) {
27544  #if PY_MAJOR_VERSION < 3
27545  if (t->is_unicode) {
27546  *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL);
27547  } else if (t->intern) {
27548  *t->p = PyString_InternFromString(t->s);
27549  } else {
27550  *t->p = PyString_FromStringAndSize(t->s, t->n - 1);
27551  }
27552  #else
27553  if (t->is_unicode | t->is_str) {
27554  if (t->intern) {
27555  *t->p = PyUnicode_InternFromString(t->s);
27556  } else if (t->encoding) {
27557  *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL);
27558  } else {
27559  *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1);
27560  }
27561  } else {
27562  *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1);
27563  }
27564  #endif
27565  if (!*t->p)
27566  return -1;
27567  if (PyObject_Hash(*t->p) == -1)
27568  return -1;
27569  ++t;
27570  }
27571  return 0;
27572 }
27573 
27574 static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) {
27575  return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str));
27576 }
27577 static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) {
27578  Py_ssize_t ignore;
27579  return __Pyx_PyObject_AsStringAndSize(o, &ignore);
27580 }
27581 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
27582 #if !CYTHON_PEP393_ENABLED
27583 static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
27584  char* defenc_c;
27585  PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL);
27586  if (!defenc) return NULL;
27587  defenc_c = PyBytes_AS_STRING(defenc);
27588 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
27589  {
27590  char* end = defenc_c + PyBytes_GET_SIZE(defenc);
27591  char* c;
27592  for (c = defenc_c; c < end; c++) {
27593  if ((unsigned char) (*c) >= 128) {
27594  PyUnicode_AsASCIIString(o);
27595  return NULL;
27596  }
27597  }
27598  }
27599 #endif
27600  *length = PyBytes_GET_SIZE(defenc);
27601  return defenc_c;
27602 }
27603 #else
27604 static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
27605  if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL;
27606 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
27607  if (likely(PyUnicode_IS_ASCII(o))) {
27608  *length = PyUnicode_GET_LENGTH(o);
27609  return PyUnicode_AsUTF8(o);
27610  } else {
27611  PyUnicode_AsASCIIString(o);
27612  return NULL;
27613  }
27614 #else
27615  return PyUnicode_AsUTF8AndSize(o, length);
27616 #endif
27617 }
27618 #endif
27619 #endif
27620 static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
27621 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
27622  if (
27623 #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
27624  __Pyx_sys_getdefaultencoding_not_ascii &&
27625 #endif
27626  PyUnicode_Check(o)) {
27627  return __Pyx_PyUnicode_AsStringAndSize(o, length);
27628  } else
27629 #endif
27630 #if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE))
27631  if (PyByteArray_Check(o)) {
27632  *length = PyByteArray_GET_SIZE(o);
27633  return PyByteArray_AS_STRING(o);
27634  } else
27635 #endif
27636  {
27637  char* result;
27638  int r = PyBytes_AsStringAndSize(o, &result, length);
27639  if (unlikely(r < 0)) {
27640  return NULL;
27641  } else {
27642  return result;
27643  }
27644  }
27645 }
27646 static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) {
27647  int is_true = x == Py_True;
27648  if (is_true | (x == Py_False) | (x == Py_None)) return is_true;
27649  else return PyObject_IsTrue(x);
27650 }
27651 static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) {
27652  int retval;
27653  if (unlikely(!x)) return -1;
27654  retval = __Pyx_PyObject_IsTrue(x);
27655  Py_DECREF(x);
27656  return retval;
27657 }
27658 static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const char* type_name) {
27659 #if PY_MAJOR_VERSION >= 3
27660  if (PyLong_Check(result)) {
27661  if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1,
27662  "__int__ returned non-int (type %.200s). "
27663  "The ability to return an instance of a strict subclass of int "
27664  "is deprecated, and may be removed in a future version of Python.",
27665  Py_TYPE(result)->tp_name)) {
27666  Py_DECREF(result);
27667  return NULL;
27668  }
27669  return result;
27670  }
27671 #endif
27672  PyErr_Format(PyExc_TypeError,
27673  "__%.4s__ returned non-%.4s (type %.200s)",
27674  type_name, type_name, Py_TYPE(result)->tp_name);
27675  Py_DECREF(result);
27676  return NULL;
27677 }
27678 static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) {
27679 #if CYTHON_USE_TYPE_SLOTS
27680  PyNumberMethods *m;
27681 #endif
27682  const char *name = NULL;
27683  PyObject *res = NULL;
27684 #if PY_MAJOR_VERSION < 3
27685  if (likely(PyInt_Check(x) || PyLong_Check(x)))
27686 #else
27687  if (likely(PyLong_Check(x)))
27688 #endif
27689  return __Pyx_NewRef(x);
27690 #if CYTHON_USE_TYPE_SLOTS
27691  m = Py_TYPE(x)->tp_as_number;
27692  #if PY_MAJOR_VERSION < 3
27693  if (m && m->nb_int) {
27694  name = "int";
27695  res = m->nb_int(x);
27696  }
27697  else if (m && m->nb_long) {
27698  name = "long";
27699  res = m->nb_long(x);
27700  }
27701  #else
27702  if (likely(m && m->nb_int)) {
27703  name = "int";
27704  res = m->nb_int(x);
27705  }
27706  #endif
27707 #else
27708  if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) {
27709  res = PyNumber_Int(x);
27710  }
27711 #endif
27712  if (likely(res)) {
27713 #if PY_MAJOR_VERSION < 3
27714  if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) {
27715 #else
27716  if (unlikely(!PyLong_CheckExact(res))) {
27717 #endif
27718  return __Pyx_PyNumber_IntOrLongWrongResultType(res, name);
27719  }
27720  }
27721  else if (!PyErr_Occurred()) {
27722  PyErr_SetString(PyExc_TypeError,
27723  "an integer is required");
27724  }
27725  return res;
27726 }
27727 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {
27728  Py_ssize_t ival;
27729  PyObject *x;
27730 #if PY_MAJOR_VERSION < 3
27731  if (likely(PyInt_CheckExact(b))) {
27732  if (sizeof(Py_ssize_t) >= sizeof(long))
27733  return PyInt_AS_LONG(b);
27734  else
27735  return PyInt_AsSsize_t(b);
27736  }
27737 #endif
27738  if (likely(PyLong_CheckExact(b))) {
27739  #if CYTHON_USE_PYLONG_INTERNALS
27740  const digit* digits = ((PyLongObject*)b)->ob_digit;
27741  const Py_ssize_t size = Py_SIZE(b);
27742  if (likely(__Pyx_sst_abs(size) <= 1)) {
27743  ival = likely(size) ? digits[0] : 0;
27744  if (size == -1) ival = -ival;
27745  return ival;
27746  } else {
27747  switch (size) {
27748  case 2:
27749  if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
27750  return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
27751  }
27752  break;
27753  case -2:
27754  if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
27755  return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
27756  }
27757  break;
27758  case 3:
27759  if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
27760  return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
27761  }
27762  break;
27763  case -3:
27764  if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
27765  return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
27766  }
27767  break;
27768  case 4:
27769  if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
27770  return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
27771  }
27772  break;
27773  case -4:
27774  if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
27775  return -(Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
27776  }
27777  break;
27778  }
27779  }
27780  #endif
27781  return PyLong_AsSsize_t(b);
27782  }
27783  x = PyNumber_Index(b);
27784  if (!x) return -1;
27785  ival = PyInt_AsSsize_t(x);
27786  Py_DECREF(x);
27787  return ival;
27788 }
27789 static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) {
27790  return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False);
27791 }
27792 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) {
27793  return PyInt_FromSize_t(ival);
27794 }
27795 
27796 
27797 #endif /* Py_PYTHON_H */
Mesh::nodeDiametersArray
double * nodeDiametersArray
Definition: mesh.h:69
proteus::partitionElements
int partitionElements(const MPI_Comm &PROTEUS_COMM_WORLD, Mesh &mesh, int nElements_overlap)
Definition: partitioning.cpp:2960
Mesh::interiorElementBoundariesArray
int * interiorElementBoundariesArray
Definition: mesh.h:50
Mesh::elementBoundaryNodesArray
int * elementBoundaryNodesArray
Definition: mesh.h:47
Mesh::nodeArray
double * nodeArray
Definition: mesh.h:67
Mesh::nodeElementsArray
int * nodeElementsArray
Definition: mesh.h:43
Mesh::max_nElements_node
int max_nElements_node
Definition: mesh.h:38
Mesh::pz
int pz
Definition: mesh.h:64
Mesh::nodeElementOffsets
int * nodeElementOffsets
Definition: mesh.h:44
proteus::buildQuadraticSubdomain2GlobalMappings_2d
int buildQuadraticSubdomain2GlobalMappings_2d(const MPI_Comm &PROTEUS_COMM_WORLD, Mesh &mesh, const int *elementBoundaryOffsets_subdomain_owned, const int *nodeOffsets_subdomain_owned, const int *elementBoundaryNumbering_subdomain2global, const int *nodeNumbering_subdomain2global, int &nDOF_all_processes, int &nDOF_subdomain, int &max_dof_neighbors, int *offsets_subdomain_owned, int *subdomain_l2g, int *subdomain2global, double *lagrangeNodesArray)
Definition: partitioning.cpp:4147
Mesh
Definition: mesh.h:27
Mesh::nEdges_global
int nEdges_global
Definition: mesh.h:39
Mesh::exteriorElementBoundariesArray
int * exteriorElementBoundariesArray
Definition: mesh.h:51
f
Double f
Definition: Headers.h:64
s
Double s
Definition: Headers.h:84
Mesh::nodeStarOffsets
int * nodeStarOffsets
Definition: mesh.h:54
Mesh::volume
double volume
Definition: mesh.h:70
Mesh::nNodes_elementBoundary
int nNodes_elementBoundary
Definition: mesh.h:33
Mesh::nElementBoundaries_global
int nElementBoundaries_global
Definition: mesh.h:35
partitioning.h
Mesh::hMin
double hMin
Definition: mesh.h:70
L
Double L
Definition: Headers.h:72
n
Int n
Definition: Headers.h:28
q
Double q
Definition: Headers.h:81
proteus::buildQuadraticCubeSubdomain2GlobalMappings_3d
int buildQuadraticCubeSubdomain2GlobalMappings_3d(const MPI_Comm &PROTEUS_COMM_WORLD, Mesh &mesh, const int *edgeOffsets_subdomain_owned, const int *nodeOffsets_subdomain_owned, const int *edgeNumbering_subdomain2global, const int *nodeNumbering_subdomain2global, int &nDOF_all_processes, int &nDOF_subdomain, int &max_dof_neighbors, int *offsets_subdomain_owned, int *subdomain_l2g, int *subdomain2global, double *lagrangeNodesArray)
Definition: partitioning.cpp:4585
proteus::buildQuadraticSubdomain2GlobalMappings_1d
int buildQuadraticSubdomain2GlobalMappings_1d(const MPI_Comm &PROTEUS_COMM_WORLD, Mesh &mesh, const int *elementOffsets_subdomain_owned, const int *nodeOffsets_subdomain_owned, const int *elementNumbering_subdomain2global, const int *nodeNumbering_subdomain2global, int &nDOF_all_processes, int &nDOF_subdomain, int &max_dof_neighbors, int *offsets_subdomain_owned, int *subdomain_l2g, int *subdomain2global, double *lagrangeNodesArray)
Definition: partitioning.cpp:3995
Mesh::nInteriorElementBoundaries_global
int nInteriorElementBoundaries_global
Definition: mesh.h:36
Mesh::ny
int ny
Definition: mesh.h:63
Mesh::nodeStarArray
int * nodeStarArray
Definition: mesh.h:53
Mesh::h
double h
Definition: mesh.h:70
Mesh::nNodes_element
int nNodes_element
Definition: mesh.h:32
Mesh::elementBoundaryLocalElementBoundariesArray
int * elementBoundaryLocalElementBoundariesArray
Definition: mesh.h:49
U
Double U
Definition: Headers.h:88
v
Double v
Definition: Headers.h:95
Mesh::elementBoundaryMaterialTypes
int * elementBoundaryMaterialTypes
Definition: mesh.h:56
Mesh::elementInnerDiametersArray
double * elementInnerDiametersArray
Definition: mesh.h:67
T
Double T
Definition: Headers.h:87
Mesh::V_KNOT
double * V_KNOT
Definition: mesh.h:62
z
Double * z
Definition: Headers.h:49
proteus::buildQuadraticSubdomain2GlobalMappings_3d
int buildQuadraticSubdomain2GlobalMappings_3d(const MPI_Comm &PROTEUS_COMM_WORLD, Mesh &mesh, const int *edgeOffsets_subdomain_owned, const int *nodeOffsets_subdomain_owned, const int *edgeNumbering_subdomain2global, const int *nodeNumbering_subdomain2global, int &nDOF_all_processes, int &nDOF_subdomain, int &max_dof_neighbors, int *offsets_subdomain_owned, int *subdomain_l2g, int *subdomain2global, double *lagrangeNodesArray)
Definition: partitioning.cpp:4306
Mesh::elementNodesArray
int * elementNodesArray
Definition: mesh.h:42
u
Double u
Definition: Headers.h:89
Mesh::elementBoundaryBarycentersArray
double * elementBoundaryBarycentersArray
Definition: mesh.h:68
Mesh::py
int py
Definition: mesh.h:64
Mesh::nz
int nz
Definition: mesh.h:63
Mesh::elementBoundariesArray
int * elementBoundariesArray
Definition: mesh.h:46
Mesh::elementBarycentersArray
double * elementBarycentersArray
Definition: mesh.h:68
c
Double c
Definition: Headers.h:54
Mesh::nElements_global
int nElements_global
Definition: mesh.h:30
mesh.h
Mesh::nodeMaterialTypes
int * nodeMaterialTypes
Definition: mesh.h:57
proteus::partitionNodes
int partitionNodes(const MPI_Comm &PROTEUS_COMM_WORLD, Mesh &mesh, int nNodes_overlap)
Definition: partitioning.cpp:539
Mesh::nElementBoundaries_element
int nElementBoundaries_element
Definition: mesh.h:34
Mesh::elementMaterialTypes
int * elementMaterialTypes
Definition: mesh.h:55
Mesh::elementDiametersArray
double * elementDiametersArray
Definition: mesh.h:67
Mesh::nNodes_global
int nNodes_global
Definition: mesh.h:31
Mesh::nExteriorElementBoundaries_global
int nExteriorElementBoundaries_global
Definition: mesh.h:37
Mesh::px
int px
Definition: mesh.h:64
proteus::partitionNodesFromTetgenFiles
int partitionNodesFromTetgenFiles(const MPI_Comm &PROTEUS_COMM_WORLD, const char *filebase, int indexBase, Mesh &newMesh, int nNodes_overlap)
Definition: partitioning.cpp:1464
Mesh::W_KNOT
double * W_KNOT
Definition: mesh.h:62
Mesh::elementIJK
int * elementIJK
Definition: mesh.h:60
Mesh::max_nNodeNeighbors_node
int max_nNodeNeighbors_node
Definition: mesh.h:40
proteus::buildDiscontinuousGalerkinSubdomain2GlobalMappings
int buildDiscontinuousGalerkinSubdomain2GlobalMappings(const MPI_Comm &PROTEUS_COMM_WORLD, Mesh &mesh, const int *elementOffsets_subdomain_owned, const int *elementNumbering_subdomain2global, int nDOF_element, int &nDOF_all_processes, int &nDOF_subdomain, int &max_dof_neighbors, int *offsets_subdomain_owned, int *subdomain_l2g, int *subdomain2global)
Definition: partitioning.cpp:4959
Mesh::sigmaMax
double sigmaMax
Definition: mesh.h:70
Mesh::nodeSupportArray
double * nodeSupportArray
Definition: mesh.h:69
r
Double r
Definition: Headers.h:83
Mesh::weights
double * weights
Definition: mesh.h:61
pos
double pos(double a)
Definition: testFMMandFSW.cpp:8
Mesh::edgeNodesArray
int * edgeNodesArray
Definition: mesh.h:52
Mesh::nx
int nx
Definition: mesh.h:63
Mesh::elementBoundaryDiametersArray
double * elementBoundaryDiametersArray
Definition: mesh.h:67
Mesh::elementBoundaryElementsArray
int * elementBoundaryElementsArray
Definition: mesh.h:48
Mesh::elementNeighborsArray
int * elementNeighborsArray
Definition: mesh.h:45
Mesh::U_KNOT
double * U_KNOT
Definition: mesh.h:62